IMultiPolygon implementation backed by an OGRMultiPolygon.
More...
#include <OGRMultiPolygonAdapter.hpp>
IMultiPolygon implementation backed by an OGRMultiPolygon.
Mirrors the semantics of fishnet::geometry::MultiPolygon: the polygons of a multi-polygon must neither be duplicates, nor cross, nor contain one another, which is enforced by addPolygon().
◆ numeric_type
◆ polygon_type
◆ OGRMultiPolygonAdapter() [1/3]
| fishnet::geometry::OGRMultiPolygonAdapter::OGRMultiPolygonAdapter |
( |
OGRUniquePtr< OGRMultiPolygon > && |
multiPolygonPtr | ) |
|
|
inline |
◆ OGRMultiPolygonAdapter() [2/3]
| fishnet::geometry::OGRMultiPolygonAdapter::OGRMultiPolygonAdapter |
( |
IMultiPolygon auto const & |
multiPolygon | ) |
|
|
inline |
◆ OGRMultiPolygonAdapter() [3/3]
| fishnet::geometry::OGRMultiPolygonAdapter::OGRMultiPolygonAdapter |
( |
const PolygonRange auto & |
polygons, |
|
|
bool |
checked = false |
|
) |
| |
|
inline |
Construct a multi-polygon from a range of polygons.
- Parameters
-
| polygons | range of IPolygon objects |
| checked | if true the polygons are added as they are, otherwise invalid entries (duplicates, crossing or contained polygons) are skipped |
◆ aaBB()
| Rectangle< double > fishnet::geometry::OGRMultiPolygonAdapter::aaBB |
( |
| ) |
const |
|
inline |
◆ addPolygon()
| bool fishnet::geometry::OGRMultiPolygonAdapter::addPolygon |
( |
const OGRPolygonAdapter & |
polygon | ) |
|
|
inlinenoexcept |
Add a polygon to the multi-polygon.
- Returns
- false if the polygon is a duplicate, crosses or is contained in (or contains) one of the polygons already present, true on success
◆ area()
| double fishnet::geometry::OGRMultiPolygonAdapter::area |
( |
| ) |
const |
|
inline |
◆ centroid()
| Vec2DReal fishnet::geometry::OGRMultiPolygonAdapter::centroid |
( |
| ) |
const |
|
inline |
Centroid of the multi-polygon, i.e. the centroids of its polygons weighted by area.
◆ contains() [1/3]
| bool fishnet::geometry::OGRMultiPolygonAdapter::contains |
( |
const IPoint auto & |
point | ) |
const |
|
inline |
◆ contains() [2/3]
| bool fishnet::geometry::OGRMultiPolygonAdapter::contains |
( |
const IPolygon auto & |
query | ) |
const |
|
inline |
◆ contains() [3/3]
| bool fishnet::geometry::OGRMultiPolygonAdapter::contains |
( |
const ISegment auto & |
segment | ) |
const |
|
inline |
◆ containsInHole()
| bool fishnet::geometry::OGRMultiPolygonAdapter::containsInHole |
( |
const IPolygon auto & |
query | ) |
const |
|
inline |
◆ crosses()
| bool fishnet::geometry::OGRMultiPolygonAdapter::crosses |
( |
const IPolygon auto & |
query | ) |
const |
|
inline |
◆ distance() [1/3]
| double fishnet::geometry::OGRMultiPolygonAdapter::distance |
( |
const IMultiPolygon auto & |
other | ) |
const |
|
inline |
◆ distance() [2/3]
| double fishnet::geometry::OGRMultiPolygonAdapter::distance |
( |
const IPolygon auto & |
query | ) |
const |
|
inline |
◆ distance() [3/3]
Distance between two OGR backed multi-polygons.
- Note
- mirrors the generic overloads above (0 if any pair of member polygons overlaps or touches, otherwise the smallest gap between any pair), but leaves finding that pair to GEOS instead of checking every polygon of this against every polygon of other by hand
◆ getPolygons() [1/2]
| std::vector< OGRPolygonAdapter > fishnet::geometry::OGRMultiPolygonAdapter::getPolygons |
( |
| ) |
const && |
|
inline |
- Note
- every member of the wrapped multi-polygon is canonical (
- See also
- canonicalize()), so the members are handed out without normalising them again
- Note
- ref-qualified, same as OGRRingAdapter::getSegments(): the lvalue (
&) overload below lazily reads through this on every access, cheap as long as this multi-polygon outlives the view; the rvalue (&&) overload, selected when this is itself a temporary, instead copies the polygons out into an owning vector before that temporary is destroyed.
◆ getPolygons() [2/2]
- Note
- every member of the wrapped multi-polygon is canonical (
- See also
- canonicalize()), so the members are handed out without normalising them again
- Note
- ref-qualified, same as OGRRingAdapter::getSegments(): the lvalue (
&) overload below lazily reads through this on every access, cheap as long as this multi-polygon outlives the view; the rvalue (&&) overload, selected when this is itself a temporary, instead copies the polygons out into an owning vector before that temporary is destroyed.
◆ intersections()
| std::unordered_set< Vec2DReal > fishnet::geometry::OGRMultiPolygonAdapter::intersections |
( |
const LinearGeometry auto & |
linearFeature | ) |
const |
|
inline |
◆ intersects()
| bool fishnet::geometry::OGRMultiPolygonAdapter::intersects |
( |
const LinearGeometry auto & |
linearFeature | ) |
const |
|
inline |
◆ isInside()
| bool fishnet::geometry::OGRMultiPolygonAdapter::isInside |
( |
const IPoint auto & |
point | ) |
const |
|
inline |
◆ isOnBoundary()
| bool fishnet::geometry::OGRMultiPolygonAdapter::isOnBoundary |
( |
const IPoint auto & |
point | ) |
const |
|
inline |
◆ isOutside()
| bool fishnet::geometry::OGRMultiPolygonAdapter::isOutside |
( |
const IPoint auto & |
point | ) |
const |
|
inline |
◆ removePolygon()
| bool fishnet::geometry::OGRMultiPolygonAdapter::removePolygon |
( |
const OGRPolygonAdapter & |
polygon | ) |
|
|
inlinenoexcept |
◆ size()
| size_t fishnet::geometry::OGRMultiPolygonAdapter::size |
( |
| ) |
const |
|
inlinenoexcept |
◆ toNative()
| MultiPolygon< Polygon< double > > fishnet::geometry::OGRMultiPolygonAdapter::toNative |
( |
| ) |
const |
|
inline |
◆ touches()
| bool fishnet::geometry::OGRMultiPolygonAdapter::touches |
( |
const IPolygon auto & |
query | ) |
const |
|
inline |
◆ OGRGeometryAdapter
◆ type
| constexpr GeometryType fishnet::geometry::OGRMultiPolygonAdapter::type = GeometryType::MULTIPOLYGON |
|
staticconstexpr |
The documentation for this class was generated from the following file: