[GIS] Get a JSON return from a Overpass API call jsonoverpass-api From this call: https://www.overpass-api.de/api/xapi?node[highway=speed_camera][bbox=-5.708215989569187,43.46669501043081,-5.605835010430813,43.588927989569186] I'm trying to get a JSON return. Reading the API, I don't know where to put the [out:json]: https://www.overpass-api.de/api/xapi?node[out:json][highway=speed_camera][bbox=-5.708215989569187,43.46669501043081,-5.605835010430813,43.588927989569186] Best Answer You can't get a JSON result from the XAPI-compatibility endpoint. Instead, use the standard Overpass API (“interpreter”) endpoint and put the [out:json]; at the very start of your ql query: https://www.overpass-api.de/api/interpreter?data=[out:json];node[highway=speed_camera](43.46669501043081,-5.708215989569187,43.588927989569186,-5.605835010430813);out%20meta; (note the different ordering of the bbox coordinates compared to the xapi request!) Related Solutions[GIS] Sample JSON code to get latitude and longitude values from Google API geolocation This google map tutorial may be of some use, it provides info on how to add geojson data as a layer to a google map using the API. https://developers.google.com/maps/tutorials/data/importing_data If you scroll about half way down to the 'Requesting JSONP' section you'll see a sample json file http://earthquake.usgs.gov/earthquakes/feed/geojsonp/2.5/week I hope that helps get you on your way. Regards, Rowan [GIS] Get regions containing a coordinate in Overpass-API Maybe you can find the solution via the is_in parameter of overpass-api? see these postings: http://forum.openstreetmap.org/viewtopic.php?id=29128 http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Query_for_areas_.28is_in.29]2 https://help.openstreetmap.org/questions/48088/what-makes-a-closed-way-show-up-as-an-enclosing-feature-with-query-features Related Question[GIS] Is it possible to get OSM data in geojson via overpass api using ipython[GIS] Can you restrict which OSM tags are returned by Overpass APIOverpass API return different results between Overpass Turbo export and wget
Best Answer
You can't get a JSON result from the XAPI-compatibility endpoint. Instead, use the standard Overpass API (“
interpreter
”) endpoint and put the[out:json];
at the very start of your ql query:(note the different ordering of the bbox coordinates compared to the xapi request!)