Snap a coordinate to the nearest road
routing.nearest(**kwargs) -> NearestResult { geometry, properties, type }
GET/api/v1/nearest
Snap a coordinate to the nearest road
Snap a coordinate to the nearest road
require "plaza"
plaza = Plaza::Client.new(
api_key: "My API Key",
environment: "local" # defaults to "production"
)
nearest_result = plaza.routing.nearest(lat: 0, lng: 0)
puts(nearest_result){
"geometry": {
"coordinates": [
0
],
"type": "Point"
},
"properties": {
"distance_m": 0,
"edge_id": 0
},
"type": "Feature"
}Returns Examples
{
"geometry": {
"coordinates": [
0
],
"type": "Point"
},
"properties": {
"distance_m": 0,
"edge_id": 0
},
"type": "Feature"
}