Thursday 29 November 2018

Getting shapefile of river from OpenStreetMap?


I do not want to download the whole map of an area. I just want rivers and other waterbodies present in an area in shapefiles so that I can use them in QGIS. I tried geofabrik but it is giving whole map and that also of full country while i need data of a city. Right now I am trying JOSM. will update you when it will works.



Answer



Use the Overpass Turbo API!


First, I'd go to openstreetmap.org,



You can either


1) Search for the feature you're after. I chose "south platte river", which runs through Denver. This gives the fields and tags that are used by OSM to store the data:


enter image description here


2) Identify the tags and values of the features you're after by



  1. Zooming all the way into the map

  2. Click on the layers icon on the right (the three sheets of paper)

  3. Click on the last menu entry (Map data or something similar in your language)

  4. The features on the map turn blue (make sure you're zoomed in far enough to see

  5. Click on the feature you're after


  6. The Tags and Values appear on left side of the screen, and you can proceed below...


enter image description here


Then go on over to the Overpass Turbo page, then click Wizard


Using information, the name value is South Platte River, and the waterway value is river, so you can build a query like this:


name="South Platte River" and waterway=river

Then click "build and run query"


enter image description here


The query will run and the result will show on the map:



enter image description here


Next click the "Export" option:


I like the geoJSON option


Click "Save"


Open the file in QGIS, and away you go!


enter image description here


You can do a 'save as' to save it as a new type of vector layer...


In your case, you could also use the waterway=river query to get all the rivers in the area you're after, and you can draw a manual selection box to narrow down the geography.


enter image description here


@underdark showed me this.



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...