SnapToRoadsService

Methods

Method
getSnapToRoads

getSnapToRoads(opt: SnapToRoadsRequest)


Parameters


  1. opt: SnapToRoadsRequest

Return Value: Promise


Interface SnapToRoadsRequest

Properties

Name
approaches Optional

Type: Array<ApproachType>


A semicolon-separated list indicating the side of the road from which to approach waypoints in a requested route. If provided, the number of approaches must be one more than the number of waypoints.
avoid Optional

Type: AvoidType


Setting this will ensure the route avoids ferry, tolls or highways.
geometry Optional

Type: GeometryType


Sets the output format of the route geometry in the response.If geojson is selected, the response will include geometry in polyline6 format and will also include a geojson object that defines the route polyline. Default: polyline6
interpolate Optional

Type: boolean


Enable to interpolate the path. Default: false Note: might return more points
mode Optional

Type: string


A parameter which which sets the transportation mode for the route. PS: Only the 4w/car profile is enabled by default. The other customised routing profiles are only supported in premium plan.
path

Type: Array<LngLatLike>


Pipe separated list of points along a path on which a snap to road will be done. The default maximum limit is 200
radiuses Optional

Type: Array<number>


Pipe separated Radiuses of each location for performing snap to road. Unit: meters
timestamps Optional

Type: Array<number>


Pipe separated unix timestamps for each location. Unit: seconds
tolerateOutlier Optional

Type: boolean


enable to ignore location not found in service boundary.
Note: enable this to ignore outliers, otherwise an error will be thrown.
Default: false

Interface SnapToRoadsResult

Interface SnapToRoadsResponsePoint

Properties

Name
bearing

Type: number


Bearing angle of the snapped point.
distance

Type: number


Distance of the snapped point from the original.
location

Type: { latitude: number,longitude: number }


Latitude and longitude.
name

Type: string


Name of the street the coordinate snapped to.
originalIndex

Type: number


Index of original input array.

Constants ApproachType

Constants
CURBroute will arrive at the waypoint on the driving_side of the region
UNRESTRICTEDroute can arrive at the waypoint from either side of the road

Constants AvoidType

Constants
FERRYAvoid ferry in route.
HIGHWAYAvoid highway in route.
TOLLAvoid toll in route.

Constants TravelMode

The transportation mode for the route.

Constants
AUTOdefault mode, same as car
CARcar mode
TRUCKtruck mode

Constants GeometryType

Output format of the route geometry.

Constants
GEOJSONGeojson format geometry.
POLYLINEPolyline format geometry.
POLYLINE_6Polyline6 format geometry.

© 2024 NextBillion.ai all rights reserved.