Closed vlasvlasvlas closed 8 years ago
you can use our JS client where paths[i].points already contains the geojson
Or wrap the coordinates in the following js variable:
var geojson = {
"type": "LineString",
"coordinates": coordinatesArray
};
Ups, sorry for the confusion the coordinates array is already a geojson structure of type LineString as you used points_encoded=false
So just grab e.g. the first path and pass this as geojson to the third party library:
json.paths[0].points
Hi,
i was wondering how do i transform the default answer to a valid geojson?
beacuse neither leaflet or geojson.io understand a the answer using Routing API
example:
curl "https://graphhopper.com/api/1/route?point=-34.608053,-58.459734&point=-34.709718,-58.675684&vehicle=car&locale=es&debug=false&points_encoded=false&key=[mykey]" > line_answer
and my answer: