|
Fishnet 2.0.1
Framework for Graph-Based Analysis of GIS Vector Data
|
IRing implementation backed by an OGRPolygon holding nothing but an exterior ring. More...
#include <OGRRingAdapter.hpp>


Public Types | |
| using | numeric_type = double |
Public Types inherited from fishnet::geometry::OGRAdapterBase< OGRPolygon > | |
| using | numeric_type = double |
Public Member Functions | |
| OGRRingAdapter (OGRUniquePtr< OGRLinearRing > &&ringPtr) | |
| OGRRingAdapter (OGRUniquePtr< OGRPolygon > &&polygonPtr) | |
| OGRRingAdapter (IRing auto const &ring) | |
| auto | getSegments () const &-> fishnet::util::forward_range_of< fishnet::geometry::Segment< double > > auto |
| The segments of the ring, lazily read through this adapter on every access. | |
| std::vector< fishnet::geometry::Segment< double > > | getSegments () const && |
| The segments of the ring, eagerly copied out into an owning vector. | |
| auto | getPoints () const &-> fishnet::util::forward_range_of< fishnet::geometry::Vec2DReal > auto |
| The segments of the ring, lazily read through this adapter on every access. | |
| std::vector< fishnet::geometry::Vec2DReal > | getPoints () const && |
| && | |
| const OGRRingAdapter & | getBoundary () const |
| Ring< double > | toNative () const |
| Copy the ring out into a fishnet Ring, which precomputes its segments. | |
| std::vector< OGRRingAdapter > | getHoles () const |
| Vec2DReal | centroid () const |
| Centroid of the ring, i.e. the mean of its points. | |
| bool | intersects (const LinearGeometry auto &linearFeature) const |
| std::unordered_set< Vec2DReal > | intersections (const LinearGeometry auto &linearFeature) const |
| bool | crosses (const IRing auto &other) const |
| bool | touches (const IRing auto &other) const |
| double | distance (const IRing auto &other) const |
| double | distance (const OGRRingAdapter &other) const |
| bool | contains (const IPoint auto &point) const |
| bool | contains (const ISegment auto &segment) const |
| bool | contains (const IRing auto &ring) const |
| bool | contains (const IPolygon auto &polygon) const |
| bool | contains (const OGRPolygonalAdapter &other) const |
Public Member Functions inherited from fishnet::geometry::OGRPolygonalAdapter | |
| double | area () const |
| Area enclosed by the boundary, reduced by the area of the holes. | |
| Rectangle< double > | aaBB () const |
| bool | isInside (const IPoint auto &point) const |
| bool | isOnBoundary (const IPoint auto &point) const |
| bool | isOutside (const IPoint auto &point) const |
| bool | contains (const IPoint auto &point) const |
| bool | contains (const ISegment auto &segment) const |
| bool | contains (const IRing auto &ring) const |
| bool | contains (const IPolygon auto &polygon) const |
| bool | contains (const OGRPolygonalAdapter &other) const |
Public Member Functions inherited from fishnet::geometry::OGRAdapterBase< OGRPolygon > | |
| OGRAdapterBase (OGRUniquePtr< OGRPolygon > &&geomPtr) | |
| OGRAdapterBase (OGRAdapterBase &&other) noexcept | |
| OGRAdapterBase (const OGRAdapterBase &other) | |
| OGRAdapterBase & | operator= (const OGRAdapterBase &other) |
| OGRAdapterBase & | operator= (OGRAdapterBase &&other) noexcept |
| bool | operator== (const OGRAdapterBase &other) const noexcept |
| OGRPolygon * | raw () const noexcept |
| size_t | hash () const noexcept |
| std::string | toString () const |
Static Public Attributes | |
| static constexpr GeometryType | type = GeometryType::RING |
Friends | |
| class | OGRPolygonAdapter |
| class | OGRGeometryAdapter |
Additional Inherited Members | |
Protected Types inherited from fishnet::geometry::OGRPolygonalAdapter | |
| using | Base = OGRAdapterBase< OGRPolygon > |
Protected Member Functions inherited from fishnet::geometry::OGRPolygonalAdapter | |
| void | canonicalize () noexcept |
| Bring the wrapped polygon into the canonical form of GEOS. | |
| bool | envelopeOverlaps (const IPoint auto &lhs, const IPoint auto &rhs) const noexcept |
| Whether the bounding box spanned by two points overlaps the one of this polygon. | |
| const OGRLinearRing * | exteriorRing () const noexcept |
| OGRPolygonalAdapter (OGRUniquePtr< OGRPolygon > &&polygonPtr, Canonical) | |
| Adopt a polygon which is already canonical, skipping the GEOS call. | |
| OGRPolygonalAdapter (OGRUniquePtr< OGRPolygon > &&polygonPtr) | |
| Adopt a polygon and bring it into canonical form. | |
Static Protected Member Functions inherited from fishnet::geometry::OGRPolygonalAdapter | |
| static OGRUniquePtr< OGRPolygon > | emptyPolygon () |
| static OGRLinearRing | toLinearRing (const IRing auto &ring) |
| static OGRUniquePtr< OGRPolygon > | toOGRPolygon (const IRing auto &ring) |
| Copy an arbitrary IRing into an OGRPolygon, ready to be used with GEOS. | |
| static OGRUniquePtr< OGRPolygon > | toOGRPolygon (const IPolygon auto &polygon) |
| Copy an arbitrary IPolygon into an OGRPolygon, ready to be used with GEOS. | |
| static bool | covers (const OGRGeometry &covering, const OGRGeometry &covered) |
| Boundary inclusive containment: is every point of covered also a point of covering? | |
Protected Attributes inherited from fishnet::geometry::OGRAdapterBase< OGRPolygon > | |
| OGRUniquePtr< OGRPolygon > | geomPtr |
IRing implementation backed by an OGRPolygon holding nothing but an exterior ring.
The wrapped ring is always kept closed (first point == last point), as OGR/OGC require it. The IRing facing API however exposes the open representation used throughout fishnet: a ring over the points u,v,x,y,z reports exactly those points and the five segments u-v, v-x, x-y, y-z and z-u.
&) overload returns a view that lazily reads through this on every access, cheap but only valid as long as this adapter is (e.g. a named local or a longer-lived object accessed by reference); the rvalue (&&) overload, selected when this is itself a temporary, e.g. polygon.getBoundary().getSegments() where getBoundary() hands back a fresh, unnamed OGRRingAdapter, instead copies the result out into an owning vector before that temporary is destroyed at the end of the full expression. Splitting on value category like this keeps both the common lazy path and this once-off temporary chain safe without callers having to know or care which one they hit. | using fishnet::geometry::OGRRingAdapter::numeric_type = double |
|
inline |
|
inline |
|
inline |
|
inline |
Centroid of the ring, i.e. the mean of its points.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
&&
&&
|
inline |
The segments of the ring, lazily read through this adapter on every access.
this on every iteration, which is cheap as long as the adapter it reads through outlives the view, e.g. a named local or a longer-lived object accessed by reference. && overload below for the rvalue case.
|
inline |
The segments of the ring, eagerly copied out into an owning vector.
this is about to be destroyed, e.g. polygon.getBoundary().getSegments() where getBoundary() hands back a fresh, unnamed OGRRingAdapter: the lvalue overload's view would keep reading through that temporary after it is gone, at the end of the full expression. A const & overload alone would not catch this, since a const lvalue reference binds to an rvalue too and the view would dangle just the same; only an overload specifically for rvalues lets us swap in a self-contained copy instead. Callers do not need to know or care which overload fires: both hand back a forward_range of Segment.
|
inline |
The segments of the ring, lazily read through this adapter on every access.
this on every iteration, which is cheap as long as the adapter it reads through outlives the view, e.g. a named local or a longer-lived object accessed by reference. && overload below for the rvalue case.
|
inline |
|
inline |
|
inline |
Copy the ring out into a fishnet Ring, which precomputes its segments.
Segment access on an adapter is lazy, so code walking the same ring over and over is better served by a native ring. The points come from OGR and are taken as valid, validating them again here would cost far more than the conversion itself.
|
inline |
|
friend |
|
friend |
|
staticconstexpr |