|
|
Classes | |
| struct | ggl::area_result< Geometry > |
| Meta-function defining return type of area function. More... | |
| class | ggl::concept::AreaStrategy< Strategy > |
| Checks strategy for area. More... | |
| struct | ggl::strategy_area< Tag, PointOfSegment > |
| Traits class binding an area strategy to a coordinate system. More... | |
Functions | |
| template<typename Geometry , typename Strategy > | |
| Strategy::return_type | ggl::area (Geometry const &geometry, Strategy const &strategy) |
| Calculate area of a geometry using a specified strategy. | |
| template<typename Geometry > | |
| area_result< Geometry >::type | ggl::area (Geometry const &geometry) |
| Calculate area of a geometry. | |
{
ggl::polygon<ggl::point_xy<double> > poly;
ggl::read_wkt("POLYGON((0 0,0 7,4 2,2 0,0 0))", poly);
std::cout << "Polygon area is "
<< ggl::area(poly)
<< " square units" << std::endl;
// Other coordinate system, spherical or geographic (extension)
ggl::polygon<ggl::point<float, 2, ggl::cs::spherical<ggl::degree> > > sph_poly;
ggl::read_wkt("POLYGON((0 0,0 45,45 0,0 0))", sph_poly);
std::cout << "Area is "
<< ggl::area(sph_poly)
<< " on unit sphere " << std::endl;
}
| area_result<Geometry>::type ggl::area | ( | Geometry const & | geometry | ) |
Calculate area of a geometry.
The function area returns the area of a polygon, ring, box using the default area-calculation strategy. Strategies are provided for cartesian and spherical coordinate systems The geometries should correct, polygons should be closed and according to the specified orientation (clockwise/counter clockwise)
| geometry | a geometry |
| Strategy::return_type ggl::area | ( | Geometry const & | geometry, | |
| Strategy const & | strategy | |||
| ) |
|
November 5, 2009 |
Copyright © 1995-2009 Barend Gehrels, Geodan, Amsterdam Copyright © 2008-2009 Bruno Lalande, Paris Copyright © 2009 Mateusz Loskot, Cadcorp, London |