|
Fishnet 2.0.1
Framework for Graph-Based Analysis of GIS Vector Data
|
Classes | |
| class | BoundingBoxWrapper |
| Wrapper for Polygon objects, which stores a (custom) bounding box. More... | |
| struct | ContainedOrInHoleFilter |
| BiPredicate Functor, which emits false when the polygon under test (2nd parameter) is contained in the other polygon. More... | |
| class | DelaunayTriangulation |
| Wrapper around GDAL's Delaunay triangulation (GDALTriangulationCreateDelaunay). More... | |
| class | GeometryTypeWKBAdapter |
| Convert fishnet::geometry::GeometryType <-> OGRwkbGeometryType. More... | |
| struct | HorizontalAABBOrdering |
| Comparator for sorting BoundingBoxWrappers according to left-most position of the bounding box. More... | |
| class | InvalidGeometryException |
| Exception class for geometry-related errors. More... | |
| struct | LexicographicOrder |
| Comparator for lexigraphically-ordering of Vec2D objects Compares first the x-Coordinate and then the y-Coordinate. More... | |
| class | Line |
| Implementation of a line. More... | |
| class | MultiPolygon |
| Implementation of a Multi-Polygon. More... | |
| class | OGRAdapterBase |
| Base class for OGR geometry adapters, which owns an OGR geometry. More... | |
| class | OGRGeometryAdapter |
| Adapter for an OGRGeometry of statically unknown type, as handed out by a data source. More... | |
| class | OGRMultiPolygonAdapter |
| IMultiPolygon implementation backed by an OGRMultiPolygon. More... | |
| class | OGRPolygonAdapter |
| IPolygon implementation backed by an OGRPolygon. More... | |
| class | OGRPolygonalAdapter |
| Common base of the OGR backed adapters which enclose an area. More... | |
| class | OGRRingAdapter |
| IRing implementation backed by an OGRPolygon holding nothing but an exterior ring. More... | |
| class | Polygon |
| Polygon implementation A Polygon consist of a boundary (IRing) and zero or more holes (IRing) More... | |
| struct | PolygonNeighbours |
| class | Ray |
| Implementation of a ray A ray consist of an origin and the direction of the ray. More... | |
| class | Rectangle |
| Implementation of a rectangle Stores top,right,bottom and left point of the rectangle. More... | |
| class | Ring |
| Implementation of a ring. More... | |
| class | Segment |
| Implementation of a segment. More... | |
| class | SimplePolygon |
| Simple polygon implementation with no holes. More... | |
| class | SweepLine |
| Generic Sweep Line template Stores a Sweep Line Status (SLS), keeping track of the current state of the sweep Stores an Event Queue for processing the events in the appropiate order. More... | |
| class | Triangle |
| Triangle shape implementation Inherits from SimplePolygon<T> (a 3-vertex ring) More... | |
| class | Vec2D |
| Implementation of a two-dimensional vector. More... | |
| struct | VerticalAABBOrdering |
| Comparator for sorting BoundingBoxWrappers according to top-most position of the bounding box. More... | |
| struct | YLexicographicOrder |
| Comparator for lexigraphically-ordering of Vec2D objects, with y Coordinate first. More... | |
Concepts | |
| concept | IBoundingBoxWrapper |
| concept | GeometryBase |
| concept | LinearGeometry |
| concept | Shape |
| A geometry enclosing an area: a ring, a polygon or a multi-polygon. | |
| concept | Geometry |
| concept | DynamicGeometry |
| A geometry which carries its type at runtime instead of statically. | |
| concept | AnyGeometry |
| A geometry of a statically known type, or one which only knows it at runtime. | |
| concept | ILine |
| Interface for a line A line is defined through two points p and q, defining a direction vector. | |
| concept | IMultiPolygon |
| Interface for a multi-polygon A multi-polygon is a collection of polygons. | |
| concept | IPoint |
| Interface for a point. | |
| concept | IPointOptional |
| concept | PointRange |
| concept | IPolygon |
| Interface for a polygon A polygon is a two-dimensional shape defined by a boundary and zero or more holes. | |
| concept | PolygonRange |
| concept | IRay |
| Interface for a ray A ray is defined through its origin and a direction. | |
| concept | IEnvelope |
| concept | IRing |
| Interface for a ring A ring is a closed loop of segments, forming a boundary of a shape. | |
| concept | RingRange |
| concept | ISegment |
| Interface for a segment A segment is formed between two points p and q, containing only the points on the line between the points. | |
| concept | SegmentRange |
| concept | OGRLayerGeometry |
| A geometry an OGR layer can be read into and written from. | |
| concept | OGRWritableGeometry |
| A geometry which can be written to an OGR data source. | |
Typedefs | |
| using | Vec2DStd = Vec2D< fishnet::math::DEFAULT_NUMERIC > |
| using | Vec2DReal = Vec2D< fishnet::math::DEFAULT_FLOATING_POINT > |
| template<typename T > | |
| using | OGRUniquePtr = std::unique_ptr< T, __impl::OGRGeometryDeleter > |
| template<typename G > | |
| using | NarrowTarget = decltype(__impl::narrowTargetOf< G >()) |
| What narrowTo<G>() produces: G itself for one of the OGRLayerGeometry types, otherwise whichever OGR adapter models the same kind of shape as G. | |
Enumerations | |
| enum class | EventType { INSERT , REMOVE } |
| enum class | PointLocation { INSIDE , OUTSIDE , BOUNDARY } |
| enum class | GeometryType { POINT , SEGMENT , RAY , LINE , RING , POLYGON , MULTIPOLYGON } |
Functions | |
| template<std::ranges::forward_range R> requires IPoint<std::ranges::range_value_t<R>> | |
| DelaunayTriangulation (R const &) -> DelaunayTriangulation< std::ranges::range_value_t< R > > | |
| template<std::ranges::forward_range R> requires IPoint<std::ranges::range_value_t<R>> | |
| DelaunayTriangulation (R const &, double, bool) -> DelaunayTriangulation< std::ranges::range_value_t< R > > | |
| static constexpr fishnet::Option< Vec2DReal > | linearIntersection (ILine auto const &l, ILine auto const &r) noexcept |
| Computation of line intersection. | |
| static constexpr fishnet::Option< Vec2DReal > | linearIntersection (LinearGeometry auto const &lhs, LinearGeometry auto const &rhs) |
| Generic wrapper for intersections between linear features. | |
| static constexpr bool | areParallel (LinearGeometry auto const &lhs, LinearGeometry auto const &rhs) noexcept |
| static constexpr bool | intersect (LinearGeometry auto const &lhs, LinearGeometry auto const &rhs) noexcept |
| template<math::Number T> | |
| constexpr Vec2D< T > | nearestNeighbour (const Vec2D< T > &query, std::set< Vec2D< T >, LexicographicOrder > const &points) noexcept |
| Compute the nearest neighbour for a query point. | |
| template<math::Number T> | |
| constexpr std::vector< Vec2D< T > > | kNearestNeighbours (const Vec2D< T > &query, std::set< Vec2D< T >, LexicographicOrder > const &points, const size_t k) noexcept |
| Compute the k nearest neighours for a query point. | |
| template<typename T > | |
| constexpr std::vector< std::pair< Vec2D< T >, std::vector< Vec2D< T > > > > | AllKNearestNeighbours (util::forward_range_of< Vec2D< T > > auto const &points, const size_t k) noexcept |
| Compute the k nearest neighbours for each point. | |
| template<fishnet::math::Number T> | |
| static constexpr bool | isValidPolygonalRing (util::random_access_range_of< Segment< T > > auto const &segments) noexcept |
| Decides whether a range of segments is a valid, closed polygonal ring. | |
| template<fishnet::math::Number T> | |
| static constexpr void | verifyPolygonalRing (util::random_access_range_of< Segment< T > > auto const &segments) |
| Verify a range segments is a valid, closed polygonal ring. | |
| static Vec2DReal | closestPointOnSegment (ISegment auto const &segment, IPoint auto const &point) noexcept |
| Compute the point on the segment, closest to the query point. | |
| static std::pair< Vec2DReal, Vec2DReal > | closestPoints (ISegment auto const &lhs, ISegment auto const &rhs) noexcept |
| Compute the pair of nearest points for two segments. | |
| static std::pair< Vec2DReal, Vec2DReal > | closestPoints (const IRing auto &lhs, const IRing auto &rhs) noexcept |
| Ring overload to compute the closest pair of points This function uses the segment on the boundary of the shape to compute the closest pair of points, assuming that the rings do not contain each other. | |
| template<Shape S, Shape T, typename = std::enable_if_t<IPolygon<S> || IPolygon<T>>> | |
| static std::pair< Vec2DReal, Vec2DReal > | closestPoints (const S &lhs, const T &rhs) noexcept |
| Overload for polygons to compute the closest pair of points. | |
| static std::pair< Vec2DReal, Vec2DReal > | closestPoints (const IMultiPolygon auto &lhs, const IMultiPolygon auto &rhs) noexcept |
| Overload for multiPolygons to compute the closest pair of points. | |
| static fishnet::math::DEFAULT_FLOATING_POINT | shapeDistance (Shape auto const &lhs, Shape auto const &rhs, util::BiFunction< Vec2DReal, Vec2DReal, fishnet::math::DEFAULT_FLOATING_POINT > auto const &distanceFunction) noexcept |
| Compute the distance between two shapes, with custom distance function. | |
| static fishnet::math::DEFAULT_FLOATING_POINT | shapeDistance (Shape auto const &lhs, Shape auto const &rhs) noexcept |
| Default shapeDistance overload. | |
| template<PolygonRange R, util::BiPredicate< std::ranges::range_value_t< R > > BinaryFilter, util::Predicate< std::ranges::range_value_t< R > > Filter = util::TruePredicate> | |
| static std::vector< std::ranges::range_value_t< R > > | filter (const R &polygons, BinaryFilter binaryCondition, Filter condition=Filter()) noexcept |
| Filters a range of polygons and returns a list of all polygons that pass the filter(s) | |
| template<PolygonRange R, util::Predicate< std::ranges::range_value_t< R > > Filter> | |
| static std::vector< std::ranges::range_value_t< R > > | filter (const R &polygons, Filter condition) noexcept |
| Polygon Filter overload with only a unary filter. | |
| template<std::ranges::forward_range R, class Proj , geometry::Shape G = std::invoke_result_t<Proj,std::ranges::range_value_t<std::remove_cvref_t<R>>>> | |
| static std::vector< std::ranges::range_value_t< R > > | filter (const R &elements, const Proj &proj, util::BiPredicate< G, G > auto binaryCondition, util::Predicate< G > auto condition) |
| template<typename R , LinearGeometry L> | |
| static constexpr bool | ringIntersects (const R &ring, const L &linearFeature) noexcept |
| test whether a linear feature intersects a ring Check every intersection of the linear feature with the segments of the ring: If the endpoints of the intersected segment are on opposite sides of the linear feature -> TRUE If intersection point is vertex of the ring: s1.p()--------—s1.q() == intersection point == s2.p()-------—s2.q() -> Test if s1.p() and s2.() are on the same side of the linear feature, if not it must be a intersection -> TRUE Additional checks depending on type linear feature: | |
| template<math::Number T> | |
| Line (Vec2D< T >, Vec2D< T >) -> Line< T > | |
| template<math::Number T> | |
| Polygon (const Ring< T > &, auto) -> Polygon< T > | |
| template<math::Number T> | |
| Polygon (const SimplePolygon< T > &, auto) -> Polygon< T > | |
| template<Shape S> | |
| Rectangle (const S &) -> Rectangle< typename S::numeric_type > | |
| template<std::ranges::range R> | |
| static Rectangle< typename std::ranges::range_value_t< R >::numeric_type > | minimalBoundingBox (const R &polygons) |
| Helper function to get the common bounding box for a range of polygons. | |
| template<std::ranges::random_access_range R> | |
| Ring (const R &) -> Ring< typename std::ranges::range_value_t< R >::numeric_type > | |
| template<typename T > | |
| Ring (std::initializer_list< Vec2D< T > > &&points) -> Ring< T > | |
| template<math::Number T> | |
| SimplePolygon (const Ring< T > &) -> SimplePolygon< T > | |
| template<typename T > | |
| SimplePolygon (std::initializer_list< Vec2D< T > > &&points) -> SimplePolygon< T > | |
| template<std::ranges::random_access_range R> | |
| SimplePolygon (const R &) -> SimplePolygon< typename std::ranges::range_value_t< R >::numeric_type > | |
| template<math::Number T> | |
| Triangle (const Vec2D< T > &, const Vec2D< T > &, const Vec2D< T > &) -> Triangle< T > | |
| template<fishnet::math::Number T, fishnet::math::Number U> | |
| constexpr auto | operator* (U scalar, const IPoint auto &vector) noexcept |
| Reversed multiplication operator, allowing commutative behavior: e.g.: Vec2D(1,1) * 2 == 2 * Vec2D(1,1) | |
Variables | |
| static const Line< double > | X_AXIS = Line<double>(0.0,0.0) |
| static const Line< double > | Y_AXIS = Line<double>(Vec2D<double>(0,0),Vec2D<double>(0,1)) |
| using fishnet::geometry::NarrowTarget = typedef decltype(__impl::narrowTargetOf<G>()) |
What narrowTo<G>() produces: G itself for one of the OGRLayerGeometry types, otherwise whichever OGR adapter models the same kind of shape as G.
This is what lets narrowTo() also accept a plain fishnet::geometry::Ring/Polygon/MultiPolygon (or any other IRing/IPolygon/IMultiPolygon), and not just the OGR adapters listed there.
| using fishnet::geometry::OGRUniquePtr = typedef std::unique_ptr<T, __impl::OGRGeometryDeleter> |
| using fishnet::geometry::Vec2DReal = typedef Vec2D<fishnet::math::DEFAULT_FLOATING_POINT> |
| using fishnet::geometry::Vec2DStd = typedef Vec2D<fishnet::math::DEFAULT_NUMERIC> |
|
strong |
|
strong |
|
strong |
|
constexprnoexcept |
Compute the k nearest neighbours for each point.
| T | numeric type of the points |
| points | range of points |
| k | amount of nearest neighbours to compute |
|
inlinestaticconstexprnoexcept |
|
staticnoexcept |
Compute the point on the segment, closest to the query point.
| segment | |
| point |
|
staticnoexcept |
Overload for multiPolygons to compute the closest pair of points.
| lhs | multi-polygon |
| rhs | other multi-polygon |
|
staticnoexcept |
Ring overload to compute the closest pair of points This function uses the segment on the boundary of the shape to compute the closest pair of points, assuming that the rings do not contain each other.
| lhs | ring |
| rhs | other ring |
|
staticnoexcept |
Overload for polygons to compute the closest pair of points.
| lhs | polygon |
| rhs | other polygon |
|
staticnoexcept |
Compute the pair of nearest points for two segments.
| lhs | |
| rhs |
| fishnet::geometry::DelaunayTriangulation | ( | R const & | ) | -> DelaunayTriangulation< std::ranges::range_value_t< R > > |
| fishnet::geometry::DelaunayTriangulation | ( | R const & | , |
| double | , | ||
| bool | |||
| ) | -> DelaunayTriangulation< std::ranges::range_value_t< R > > |
|
static |
|
staticnoexcept |
Filters a range of polygons and returns a list of all polygons that pass the filter(s)
| R | range type |
| BinaryFilter | BiPredicate type |
| Filter | Predicate type |
| polygons | range of polygons of type P |
| binaryCondition | |
| condition |
|
staticnoexcept |
Polygon Filter overload with only a unary filter.
| R | range type |
| Filter | Predicate type |
| polygons | range of Polygons of type P |
| condition |
|
staticconstexprnoexcept |
|
staticconstexprnoexcept |
Decides whether a range of segments is a valid, closed polygonal ring.
| T | numeric type of the segments |
| segments | range of segments |
|
constexprnoexcept |
Compute the k nearest neighours for a query point.
| T | numeric type of the points |
| query | query point |
| points | lexicographically ordered set of points |
| k | amount of nearest neighbours to compute |
| fishnet::geometry::Line | ( | Vec2D< T > | , |
| Vec2D< T > | |||
| ) | -> Line< T > |
|
inlinestaticconstexprnoexcept |
Computation of line intersection.
| l | line object |
| r | line object |
|
inlinestaticconstexpr |
Generic wrapper for intersections between linear features.
| lhs | linear geometry |
| rhs | linear geometry |
|
static |
Helper function to get the common bounding box for a range of polygons.
| R | type of polygon range |
| polygons | polygons to compute the bounding box around |
|
constexprnoexcept |
Compute the nearest neighbour for a query point.
| T | numeric type of the points |
| query | query point |
| points | lexicographically ordered set of points |
|
constexprnoexcept |
Reversed multiplication operator, allowing commutative behavior: e.g.: Vec2D(1,1) * 2 == 2 * Vec2D(1,1)
| T | numeric type of vector |
| U | numeric type of scalar |
| scalar | |
| vector |
| fishnet::geometry::Polygon | ( | const Ring< T > & | , |
| auto | |||
| ) | -> Polygon< T > |
| fishnet::geometry::Polygon | ( | const SimplePolygon< T > & | , |
| auto | |||
| ) | -> Polygon< T > |
| fishnet::geometry::Rectangle | ( | const S & | ) | -> Rectangle< typename S::numeric_type > |
| fishnet::geometry::Ring | ( | const R & | ) | -> Ring< typename std::ranges::range_value_t< R >::numeric_type > |
| fishnet::geometry::Ring | ( | std::initializer_list< Vec2D< T > > && | points | ) | -> Ring< T > |
|
staticconstexprnoexcept |
test whether a linear feature intersects a ring Check every intersection of the linear feature with the segments of the ring: If the endpoints of the intersected segment are on opposite sides of the linear feature -> TRUE If intersection point is vertex of the ring: s1.p()--------—s1.q() == intersection point == s2.p()-------—s2.q() -> Test if s1.p() and s2.() are on the same side of the linear feature, if not it must be a intersection -> TRUE Additional checks depending on type linear feature:
Shared by all IRing implementations, such that a ring backed by e.g. an OGRLinearRing reports the same intersections as fishnet::geometry::Ring.
| ring | ring object, its getSegments() must be a random access range |
| linearFeature |
|
staticnoexcept |
|
staticnoexcept |
Compute the distance between two shapes, with custom distance function.
| lhs | |
| rhs | |
| distanceFunction | custom distance function. Allows computation in other units (e.g. meters instead of angular units) |
| fishnet::geometry::SimplePolygon | ( | const R & | ) | -> SimplePolygon< typename std::ranges::range_value_t< R >::numeric_type > |
| fishnet::geometry::SimplePolygon | ( | const Ring< T > & | ) | -> SimplePolygon< T > |
| fishnet::geometry::SimplePolygon | ( | std::initializer_list< Vec2D< T > > && | points | ) | -> SimplePolygon< T > |
| fishnet::geometry::Triangle | ( | const Vec2D< T > & | , |
| const Vec2D< T > & | , | ||
| const Vec2D< T > & | |||
| ) | -> Triangle< T > |
|
staticconstexpr |
Verify a range segments is a valid, closed polygonal ring.
| T | numeric type of the segments |
| segments | range of segments |
| InvalidGeometryException | when the segments do not form a valid polygonal ring |