Hi, I use the OverpassAPI to extract some data. Exporting them via the webinterface as geoJSON works fine but when I use an OverpassQL-link (example below) I receive a JSON-file with a different structure. How can I get a geoJSON-file with this link? regards asked 09 Jul '13, 12:34 Ogmios |
Overpass returns a JSON format that is a direct representation of OSM data. This is not GeoJSON, because GeoJSON doesn't fit the OSM data structure. In particular, in GeoJSON everything has a geometry, and topological incidence (like two ways sharing a node) is not represented directly. Also, GeoJSON differentiates between simple polygons and non-closed ways, which OSM does not (or again, not directly). For these reasons, you need a conversion from OSM data to GeoJSON, and this is what Overpass Turbo does. answered 13 Jul '13, 10:24 Roland Olbricht |
I have looked at the code that Overpass Turbo uses, in the hope that I could adapt the OSM4Leaflet.js code to easily add standard overpass JSON queries to my map. This is the sort of thing I'd ideally like to be able to do:
Unfortunately I can't understand the complexities of the code used by Overpass Turbo. Could anyone help me out? It would be very useful to have a simple method be generally known. answered 06 Aug '13, 15:41 Tom Chance |
How does the structure differ? Is it a valid GeoJSON file? Did you remove the duplicated semicolon at the end of your link?