Routing class for finding routes on a network of LineStrings. The LineString network must have coordinates that are shared between the LineStrings in order to find a route.

Implements

Constructors

  • Parameters

    • options: {
          network: FeatureCollection<LineString, GeoJsonProperties>;
          routeFinder: RouteFinder;
          useCache?: boolean;
      }
      • network: FeatureCollection<LineString, GeoJsonProperties>
      • routeFinder: RouteFinder
      • OptionaluseCache?: boolean

    Returns Routing

Methods

  • Return the closest network coordinate to the input coordinate

    Parameters

    • inputCoordinate: Position

      The coordinate to find the closest network coordinate to

    Returns null | Position

    a coordinate on the network or null if no coordinate is found

  • Get the route between two coordinates returned as a GeoJSON LineString

    Parameters

    • startCoord: Position

      start coordinate

    • endCoord: Position

      end coordinate

    Returns null | Feature<LineString, GeoJsonProperties>

    The route as a GeoJSON LineString