UNPKG

terra-route

Version:

A library for routing along GeoJSON LineString networks

18 lines (17 loc) 913 B
import { Feature, FeatureCollection, LineString, Point } from 'geojson'; /** * Counts the unique nodes and edges in a GeoJSON FeatureCollection of LineString features. * @param featureCollection - A GeoJSON FeatureCollection containing LineString features * @returns An object containing the count of unique nodes and edges */ export declare function graphGetNodeAndEdgeCount(featureCollection: FeatureCollection<LineString>): { nodeCount: number; edgeCount: number; }; /** * Converts a FeatureCollection of LineString features into a FeatureCollection of Point features, * where each unique coordinate in the LineStrings becomes a Point. * @param lines - A GeoJSON FeatureCollection containing LineString features * @returns A FeatureCollection of Point features representing unique nodes */ export declare function graphGetNodesAsPoints(lines: FeatureCollection<LineString>): Feature<Point>[];