This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

How to use output of overpass api

0

Dear All, I have extracted way data for Railways over one country with [out:json], now how can i use this data to get all ways on google earth or QGIS? I am very new to this , just ignore for any stupidity.

( area["ISO3166-1:alpha2"="PK"];) ->.a;
        way["railway"]
          (area.a);
         (._;>;);
 out body;

asked 13 Apr '20, 18:23

PRailway's gravatar image

PRailway
31337
accept rate: 0%

edited 13 Apr '20, 18:25

1

if by "get all ways on google earth" you mean display them on GE then converting to KML or GPX would be best. You don't say if you're using Overpass turbo but there's an export tab which provides the options. PS if your after just the rail tracks it better to do a more specific search.

https://overpass-turbo.eu/s/SN5

(13 Apr '20, 21:14) DaveF

Thank you sir, does your query give me the whole railway network? and what is the difference between both?

(14 Apr '20, 07:48) PRailway
1

@PRailway it returns all ways within PK which are tagged as railway=rail. Whether it's the 'whole network', you're probably better placed to tell. Your original routine probably won't find all 'railway' objects as you were only searching for ways types, omitting nodes & relations. Please read the wiki to understand the differences.

@scai It's not a cross post as it's a forum independent of OSM. Answers from one do not appear in the other.

(14 Apr '20, 11:16) DaveF

One Answer:

1

i mean best way in this case - export result as geojson (menu: "export" - "as geojson") and open this file.geojson in QGIS - in this way you save all geometries and attribute data. For add, you can use plugin "QuickMapServices" in QGIS to see imagery covers as WMS\TMS, for example, bing imagery, Google satellite imagery, Openstreetmap Mapnik cover and more.

answered 14 Apr '20, 08:44

ForstEK's gravatar image

ForstEK
813
accept rate: 16%

edited 14 Apr '20, 08:47

Source code available on GitHub .