polygon.qbk 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. [/============================================================================
  2. Boost.Geometry (aka GGL, Generic Geometry Library)
  3. Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
  4. Copyright (c) 2009-2012 Barend Gehrels, Amsterdam, the Netherlands.
  5. Copyright (c) 2009-2012 Bruno Lalande, Paris, France.
  6. Use, modification and distribution is subject to the Boost Software License,
  7. Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  8. http://www.boost.org/LICENSE_1_0.txt)
  9. =============================================================================/]
  10. [section:concept_polygon Polygon Concept]
  11. [heading Description]
  12. [concept Polygon..polygon]
  13. A polygon is ['A polygon is a planar surface defined by one exterior boundary and zero or more interior boundaries]
  14. (__ogc_sf__).
  15. So the definition of a Boost.Geometry polygon differs a bit from e.g. Wiki, where a polygon does not have holes. A
  16. polygon of Boost.Geometry is a polygon with or without holes.
  17. ['(A polygon without holes is a ['helper geometry] within Boost.Geometry, and referred to as a ring.)]
  18. [heading Concept Definition]
  19. The Polygon Concept is defined as following:
  20. * there must be a specialization of `traits::tag` defining `polygon_tag` as type
  21. * there must be a specialization of `traits::ring_type` defining the type of its exterior ring and interior rings as type
  22. * this type defined by `ring_type` must fulfill the [link geometry.reference.concepts.concept_ring Ring Concept]
  23. * there must be a specialization of `traits::interior_type` defining the type of the collection of its interior rings as type;
  24. this collection itself must fulfill a Boost.Range Random Access Range Concept
  25. * there must be a specialization of `traits::exterior_ring` with two functions named `get`, returning the exterior ring, one being const, the other being non const
  26. * there must be a specialization of `traits::interior_rings` with two functions named `get`, returning the interior rings, one being const, the other being non const
  27. [heading Rules]
  28. Besides the Concepts, which are checks on compile-time, there are some other
  29. rules that valid polygons must fulfill. This follows the opengeospatial rules (see link
  30. above).
  31. * Polygons are simple geometric objects (See also [@http://en.wikipedia.org/wiki/Simple_polygon wiki]
  32. but holes are allowed in __boost_geometry__ polygons).
  33. * If the polygons underlying `ring_type` is defined as clockwise, the exterior
  34. ring must have the clockwise orientation, and any interior ring must be
  35. reversed w.r.t. the defined orientation (so: counter clockwise for clockwise exterior rings).
  36. If the `ring_type` is defined counter clockwise, it is vice versa.
  37. * If the polygons underlying `ring_type` is defined as closed, all rings must be
  38. closed: the first point must be spatially equal to the last point.
  39. * The interior is a connected point set.
  40. * There should be no self intersections, but self tangencies (between
  41. exterior/interior rings) are allowed (as long as the interior is a connected
  42. point set.
  43. * There should be no cut lines, spikes or punctures.
  44. * The interior rings should be located within the exterior ring. Interior rings
  45. may not be located within each other.
  46. The algorithms such as intersection, area, centroid, union, etc. do not check
  47. validity. There will be an algorithm is_valid which checks for
  48. validity against these rules, at runtime, and which can be called (by the library
  49. user) before.
  50. If the input is invalid, the output might be invalid too. For example: if a polygon
  51. which should be closed is not closed, the area will be incorrect.
  52. [heading Available Models]
  53. * [link geometry.reference.models.model_polygon polygon]
  54. * a Boost.Polygon polygon_with_holes_data (requires `#include boost/geometry/geometries/adapted/boost_polygon/polygon.hpp>`)
  55. [endsect]