Skip to content

Get Rhine and Oder as GeoJSON

26. March 2013

No detailled descriptions…just snippets on how I extracted the rivers Rhine and Oder from the central OSM-database with the help of OverpassAPI-turbo.

I needed that data for the descriptions in a previous post!

Getting the Oder:

<osm-script output="json">
 <union>
 <query type="relation">
 <has-kv k="name:en" v="Oder"/>
 </query>
 </union>
 <union>
 <item />
 <recurse type="down"/>
 </union>
 <print mode="body" order="quadtile"/>
 </osm-script>

Getting the Rhine:

<osm-script output="json">
 <union>
 <query type="relation">
 <has-kv k="name:en" v="Rhine"/>
 </query>
 </union>
 <union>
 <item />
 <recurse type="down"/>
 </union>
 <print mode="body" order="quadtile"/>
 </osm-script>

Although I have already defined, that the output should be in *.json…I need the data in GeoJSON format. OverpassAPI-turbo offers the possibility to export the queried data as GeoJSON…let’s use this tool!

Just open the dialog…Ctrl+C…new file…Ctrl+V…Save as…Done!

Advertisements
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: