UNPKG

terra-route

Version:

A library for routing along GeoJSON LineString networks

10 lines (9 loc) 737 B
import { FeatureCollection, LineString } from 'geojson'; /** * Counts the number of connected components in a graph represented by LineString features in a GeoJSON FeatureCollection. * Each LineString is treated as an edge in the graph, and connected components are determined by shared coordinates. * @param featureCollection - A GeoJSON FeatureCollection containing LineString features * @returns The number of connected components in the graph represented by the LineStrings */ export declare function graphGetConnectedComponentCount(featureCollection: FeatureCollection<LineString>): number; export declare function graphGetConnectedComponents(featureCollection: FeatureCollection<LineString>): FeatureCollection<LineString>[];