validity_failure_type.hpp 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2015, Oracle and/or its affiliates.
  3. // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
  4. // Licensed under the Boost Software License version 1.0.
  5. // http://www.boost.org/users/license.html
  6. #ifndef BOOST_GEOMETRY_ALGORITHMS_VALIDITY_FAILURE_TYPE_HPP
  7. #define BOOST_GEOMETRY_ALGORITHMS_VALIDITY_FAILURE_TYPE_HPP
  8. namespace boost { namespace geometry
  9. {
  10. /*!
  11. \brief Enumerates the possible validity failure types for a geometry
  12. \ingroup enum
  13. \details The enumeration validity_failure_type enumerates the possible
  14. reasons for which a geometry may be found as invalid by the
  15. is_valid algorithm.
  16. Besides the values that indicate invalidity, there is an
  17. additional value (no_failure) that indicates validity.
  18. \qbk{
  19. [heading See also]
  20. [link geometry.reference.algorithms.is_valid The is_valid
  21. algorithm taking a reference to validity_failure_type as second argument]
  22. }
  23. */
  24. enum validity_failure_type
  25. {
  26. /// The geometry is valid
  27. ///
  28. no_failure = 0,
  29. /// The geometry has a very small number of points, e.g., less
  30. /// than 2 for linestrings, less than 3 for open rings, a closed
  31. /// multi-polygon that contains a polygon with less than 4 points, etc.
  32. /// (applies to linestrings, rings, polygons, multi-linestrings
  33. /// and multi-polygons)
  34. failure_few_points = 10,
  35. /// The topological dimension of the geometry is smaller than its
  36. /// dimension, e.g., a linestring with 3 identical points, an open
  37. /// polygon with an interior ring consisting of 3 collinear points, etc.
  38. /// (applies to linear and areal geometries, including segments
  39. /// and boxes)
  40. failure_wrong_topological_dimension = 11,
  41. /// The geometry contains spikes
  42. /// (applies to linear and areal geometries)
  43. failure_spikes = 12,
  44. /// The geometry has (consecutive) duplicate points
  45. /// (applies to areal geometries only)
  46. failure_duplicate_points = 13,
  47. /// The geometry is defined as closed, the starting/ending points
  48. /// are not equal
  49. /// (applies to areal geometries only)
  50. failure_not_closed = 20, // for areal geometries
  51. /// The geometry has invalid self-intersections.
  52. /// (applies to areal geometries only)
  53. failure_self_intersections = 21, // for areal geometries
  54. /// The actual orientation of the geometry is different from the one defined
  55. /// (applies to areal geometries only)
  56. failure_wrong_orientation = 22, // for areal geometries
  57. /// The geometry contains interior rings that lie outside the exterior ring
  58. /// (applies to polygons and multi-polygons only)
  59. failure_interior_rings_outside = 30, // for (multi-)polygons
  60. /// The geometry has nested interior rings
  61. /// (applies to polygons and multi-polygons only)
  62. failure_nested_interior_rings = 31, // for (multi-)polygons
  63. /// The interior of the geometry is disconnected
  64. /// (applies to polygons and multi-polygons only)
  65. failure_disconnected_interior = 32, // for (multi-)polygons
  66. /// The multi-polygon contains polygons whose interiors are not disjoint
  67. /// (applies to multi-polygons only)
  68. failure_intersecting_interiors = 40, // for multi-polygons
  69. /// The top-right corner of the box is lexicographically smaller
  70. /// than its bottom-left corner
  71. /// (applies to boxes only)
  72. failure_wrong_corner_order = 50, // for boxes
  73. /// The geometry has at least one point with an invalid coordinate
  74. /// (for example, the coordinate is a NaN)
  75. failure_invalid_coordinate = 60
  76. };
  77. }} // namespace boost::geometry
  78. #endif // BOOST_GEOMETRY_ALGORITHMS_VALIDITY_FAILURE_TYPE_HPP