graph#
Source code: sensai/geoanalytics/geopandas/graph.py
- delaunay_graph(data: numpy.ndarray, edge_weight: Callable[[numpy.ndarray, numpy.ndarray], float] = scipy.spatial.distance.euclidean)[source]#
The Delaunay triangulation of the data as networkx.Graph
- Parameters:
data –
edge_weight – function to compute weight given two coordinate points
- Returns:
instance of networx.Graph where the edges contain additional datapoints entries for “weight” and for constants.COORDINATE_PAIR_KEY
- class SpanningTree(datapoints: numpy.ndarray, tree_finder: Callable[[networkx.Graph], networkx.Graph] = networkx.minimum_spanning_tree)[source]#
Bases:
object
Wrapper around a tree-finding algorithm that will be applied on the Delaunay graph of the datapoints
- Parameters:
datapoints –
tree_finder – function mapping a graph to a subgraph. The default is minimum_spanning_tree
- class CoordinateSpanningTree(datapoints: numpy.ndarray, tree_finder: Callable[[networkx.Graph], networkx.Graph] = networkx.minimum_spanning_tree)[source]#
Bases:
SpanningTree
,GeoDataFrameWrapper
Wrapper around a tree-finding algorithm that will be applied on the Delaunay graph of the coordinates. Enhances the
SpanningTree
class by adding methods and validation specific to geospatial coordinates.- Parameters:
datapoints –
tree_finder – function mapping a graph to a subgraph. The default is minimum_spanning_tree