Fishnet 2.0.1
Framework for Graph-Based Analysis of GIS Vector Data
Loading...
Searching...
No Matches
fishnet::geometry::PolygonNeighbours Struct Reference

#include <PolygonNeighbours.hpp>

Static Public Member Functions

template<PolygonRange R, IPolygon P = std::ranges::range_value_t<R>>
static std::vector< std::pair< P, P > > delaunay (const R &polygons, util::BiPredicate< P > auto const &neighbouringPredicate, double tolerance=0.0, bool onlyEdges=true)
 Find neighbouring polygons using Delaunay triangulation on centroids.
 
template<PolygonRange R, IPolygon P = std::ranges::range_value_t<R>>
static std::vector< std::pair< P, P > > delaunay (const R &polygons)
 Overload without predicate — returns all Delaunay edges.
 
template<PolygonRange R, IPolygon P = std::ranges::range_value_t<R>>
static std::vector< std::pair< P, P > > sweepTemplate (const R &polygons, util::BiPredicate< BoundingBoxWrapper< P > > auto const &neighbouringPredicate, util::UnaryFunction< P, BoundingBoxWrapper< P > > auto const &wrapper, size_t maxNeighbours)
 Generic findNeighbouringPolygons function, which returns a list of pairs indicating the adjacencies of the polygons.
 
template<PolygonRange R, IPolygon P = std::ranges::range_value_t<R>>
static std::vector< std::pair< P, P > > sweep (const R &polygons, util::BiPredicate< P > auto &&neighbouringPredicate, util::UnaryFunction< P, BoundingBoxWrapper< P > > auto const &wrapper, size_t maxNeighbours)
 Finding neighbours of polygons using a sweepline, returns a list of pairs indicating the adjacencies of two polygons.
 
template<PolygonRange R, IPolygon P = std::ranges::range_value_t<R>>
static std::vector< std::pair< P, P > > sweep (const R &polygons, util::BiPredicate< P > auto const &neighbouringPredicate, size_t maxNeighbours)
 Overload with wrapper into default BoundingBoxWrappers (no custom bounding box allowed)
 
template<PolygonRange R>
static std::vector< std::pair< std::ranges::range_value_t< R >, std::ranges::range_value_t< R > > > sweepWithFixedBuffer (const R &polygons, fishnet::math::DEFAULT_NUMERIC bufferMultiplier, size_t maxNeighbours)
 Overload for finding neighbouring polygons with a custom buffer multiplier for the bounding boxes.
 

Member Function Documentation

◆ delaunay() [1/2]

template<PolygonRange R, IPolygon P = std::ranges::range_value_t<R>>
static std::vector< std::pair< P, P > > fishnet::geometry::PolygonNeighbours::delaunay ( const R &  polygons)
inlinestatic

Overload without predicate — returns all Delaunay edges.

Parameters
polygonsrange of polygons

◆ delaunay() [2/2]

template<PolygonRange R, IPolygon P = std::ranges::range_value_t<R>>
static std::vector< std::pair< P, P > > fishnet::geometry::PolygonNeighbours::delaunay ( const R &  polygons,
util::BiPredicate< P > auto const &  neighbouringPredicate,
double  tolerance = 0.0,
bool  onlyEdges = true 
)
inlinestatic

Find neighbouring polygons using Delaunay triangulation on centroids.

Computes the centroid for each polygon, builds a Delaunay triangulation, and returns an edge for every triangle side connecting two centroids. A BiPredicate filters which edges are considered valid neighbours.

Template Parameters
Rrange type
Ppolygon type == value type of range
Parameters
polygonsrange of polygons
neighbouringPredicateBiPredicate deciding whether two Polygons are neighbours
Returns
std::vector<std::pair<P,P>> list of pairs, indicating the neighbouring relationship of two polygons

◆ sweep() [1/2]

template<PolygonRange R, IPolygon P = std::ranges::range_value_t<R>>
static std::vector< std::pair< P, P > > fishnet::geometry::PolygonNeighbours::sweep ( const R &  polygons,
util::BiPredicate< P > auto &&  neighbouringPredicate,
util::UnaryFunction< P, BoundingBoxWrapper< P > > auto const &  wrapper,
size_t  maxNeighbours 
)
inlinestatic

Finding neighbours of polygons using a sweepline, returns a list of pairs indicating the adjacencies of two polygons.

Template Parameters
Rrange type
Ppolygon type == value type of range
Parameters
polygonsrange of polygons
neighbouringPredicateBiPredicate deciding whether two Polygons of type P are neighbours
wrapperunary function which wraps polygons of type P into BoundingBoxWrappers required for the sweepline
Returns
std::vector<std::pair<P,P>> list of pairs, indicating the neighbouring relationship of two polygons

◆ sweep() [2/2]

template<PolygonRange R, IPolygon P = std::ranges::range_value_t<R>>
static std::vector< std::pair< P, P > > fishnet::geometry::PolygonNeighbours::sweep ( const R &  polygons,
util::BiPredicate< P > auto const &  neighbouringPredicate,
size_t  maxNeighbours 
)
inlinestatic

Overload with wrapper into default BoundingBoxWrappers (no custom bounding box allowed)

Template Parameters
R
P
Parameters
polygons
neighbouringPredicateBiPredicate deciding whether two Polygons of type P are neighbours
Returns
std::vector<std::pair<P,P>> list of pairs, indicating the neighbouring relationship of two polygons

◆ sweepTemplate()

template<PolygonRange R, IPolygon P = std::ranges::range_value_t<R>>
static std::vector< std::pair< P, P > > fishnet::geometry::PolygonNeighbours::sweepTemplate ( const R &  polygons,
util::BiPredicate< BoundingBoxWrapper< P > > auto const &  neighbouringPredicate,
util::UnaryFunction< P, BoundingBoxWrapper< P > > auto const &  wrapper,
size_t  maxNeighbours 
)
inlinestatic

Generic findNeighbouringPolygons function, which returns a list of pairs indicating the adjacencies of the polygons.

Template Parameters
Rrange type
Ppolygon type == value type of range
Parameters
polygonsrange of polygons
neighbouringPredicateBiPredicate deciding whether two BoundingBoxWrappers are neighbours
wrapperunary function which wraps polygons of type P into BoundingBoxWrappers required for the sweepline
Returns
std::vector<std::pair<P,P>> list of pairs, indicating the neighbouring relationship of the polygons

◆ sweepWithFixedBuffer()

template<PolygonRange R>
static std::vector< std::pair< std::ranges::range_value_t< R >, std::ranges::range_value_t< R > > > fishnet::geometry::PolygonNeighbours::sweepWithFixedBuffer ( const R &  polygons,
fishnet::math::DEFAULT_NUMERIC  bufferMultiplier,
size_t  maxNeighbours 
)
inlinestatic

Overload for finding neighbouring polygons with a custom buffer multiplier for the bounding boxes.

Template Parameters
R
Parameters
polygons
bufferMultiplier
Returns
std::vector<std::pair<P,P>> list of pairs, indicating the neighbouring relationship of two polygons

The documentation for this struct was generated from the following file: