1

My steps: 1.) Query Overpass API and download the JSON output by this URL

https://www.overpass-api.de/api/interpreter?data=[out:json];node[route=bus];way[route=bus];relation[route=bus](52.5,13.3,52.5,13.4);out;

2.) Loading this JSON into QGIS

Issue: QGIS 3.x says, that this JSON cannot be read.

My ideal approach is to not use QuickOSM or other tools in between.

Do I miss any ETL from JSON output to QGIS?

2
  • How do you plan to use this data? The output to that query is regular JSON containing a list of relations (each containing a list of members), with no geometry info. QGIS can read GeoJSON files, but as far as I know it can't read generic JSON on its own. (I'm using 3.10.4) You'll probably have to massage your output into some other form, depending on what you want to do with it. Commented Oct 21, 2020 at 14:18
  • You can get GeoJSON via Overpass Turbo: wiki.openstreetmap.org/wiki/Overpass_turbo/GeoJSON Commented Oct 21, 2020 at 18:03

1 Answer 1

2

I found a solution. The query URL was not complete and partly wrong.

Correct URL:

https://www.overpass-api.de/api/interpreter?data=[out:json];(node[route=bus](52.5,13.3,52.5,13.4);way[route=bus](52.5,13.3,52.5,13.4);relation[route=bus](52.5,13.3,52.5,13.4););out;%3E;out;

Changes

  1. Wrapping the geometries by () to create a union query
  2. Adding the bounding box coordinates behind every geometry
  3. Adding a second output parameter to define the output of the wrapped union query.

Next step: osmtogeojson can convert JSON or osm.xml to GeoJSON

Result: GeoJSON file which can be interpreted by QGIS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.