within: detect if a geometry is inside another geometry, a.o. point-in-polygon

## Classes

class | boost::geometry::concept::WithinStrategyPolygonal< Strategy >
| Checks strategy for within (point-in-polygon) More...
struct | boost::geometry::strategy::within::services::default_strategy< TagContained, TagContaining, CastedTagContained, CastedTagContaining, CsTagContained, CsTagContaining, GeometryContained, GeometryContaining >
| Traits class binding a within determination strategy to a coordinate system. More...

## Functions

template<typename Geometry1 , typename Geometry2 >
bool | boost::geometry::within (Geometry1 const &geometry1, Geometry2 const &geometry2)
| Checks if the first geometry is completely inside the second geometry.
template<typename Geometry1 , typename Geometry2 , typename Strategy >
bool | boost::geometry::within (Geometry1 const &geometry1, Geometry2 const &geometry2, Strategy const &strategy)
| Checks if the first geometry is completely inside the second geometry using the specified strategy.

## Function Documentation

template<typename Geometry1 , typename Geometry2 >

bool boost::geometry::within | ( | Geometry1 const & | geometry1,
|  | Geometry2 const & | geometry2
| ) |  |

Checks if the first geometry is completely inside the second geometry.

The free function within checks if the first geometry is completely inside the second geometry.

Template Parameters:

  Geometry1 | Any type fulfilling a Geometry Concept
  Geometry2 | Any type fulfilling a Geometry Concept

Parameters:

  geometry1 | A model of the specified concept which might be within the second geometry
  geometry2 | A model of the specified concept which might contain the first geometry

Returns:
  true if geometry1 is completely contained within geometry2, else false

Note:
  The default strategy is used for within detection

Examples:
  03_polygon_example.cpp, c02_custom_box_example.cpp, and x01_qt_example.cpp.

template<typename Geometry1 , typename Geometry2 , typename Strategy >

bool boost::geometry::within | ( | Geometry1 const & | geometry1,
|  | Geometry2 const & | geometry2,
|  | Strategy const & | strategy
| ) |  |

Checks if the first geometry is completely inside the second geometry using the specified strategy.

The free function within checks if the first geometry is completely inside the second geometry, using the specified strategy. Reasons to specify a strategy include: use another coordinate system for calculations; construct the strategy beforehand (e.g. with the radius of the Earth); select a strategy when there are more than one available for a calculation.

Template Parameters:

  Geometry1 | Any type fulfilling a Geometry Concept
  Geometry2 | Any type fulfilling a Geometry Concept

Parameters:

  geometry1 | A model of the specified concept which might be within the second geometry
  geometry2 | A model of the specified concept which might contain the first geometry
  strategy | strategy to be used

Returns:
  true if geometry1 is completely contained within geometry2, else false

April 2, 2011 | Copyright © 2007-2011 Barend Gehrels, Amsterdam, the Netherlands Copyright © 2008-2011 Bruno Lalande, Paris, France Copyright © 2009-2010 Mateusz Loskot, London, UK