QGIS – Creating a water layer using QuickOSM
This shows how to Create a water layer in QGIS using Open Street Map data using Quick OSM. If you’ve ever struggled with displaying water, I hope you will find the following process helpful.
Workspace & plugins
QGIS 3.6, and an internet connection. I’m using a MacBook from 2015. The following plugins should be activated:
- Quick OSM
- Join Multiple Lines
When to use this approach
I use this approach when I need large scale OSM data for a specific area and haven’t downloaded a larger dataset from Geofabrik. It’s always a good practice to cross check data sources to make sure you’re not making a crazy error.
The Quick OSM is a great way to get smaller areas of data or larger areas of smaller data sets. I would download data from Geofabrik for larger areas.
QuickOSM shows up in the Vector Menu. It creates and runs queries using Overpass queries. Through practice, you become familiar with the open street map schema, but here are the queries I run.
Three settings are used
Set the Key, the Value and the Extent. More info can be found on the OSM Wiki.
- Key Describes a topic, category, or type of feature
- Value Can be any tag, but in here we choose from a distinct set of options
- Extent The area queried as shown on the screen
- Natural: Coastlines (line segments)
- Natural: Bay (polygon)
- Natural: Water (polygon)
- Waterway: Riverbank (polygon)
- Waterway: River (centerline, for naming)
Summary of useful attributes
The coastline feature is multiple line segments and should be converted into a polygon to stylize the area. It often portrays rivers that run into the ocean.
Use as a water body.
osm_type = way, natural = coastline
Portrays coastal islands as polygons.
Use as a land layer above water
osm_type = way, natural = coastline place= islet, island…
Shows water bodies
osm_type, natural, water – stream, pond, intermittent…, name = Haddon Lake
Line shows name waterway type in attributes
osm_type, natural, ele, name = weir, waterway = “Fairmount Dam”
waterway_riverbank (area and line)
No useful attributes, but fills in gaps between natural_water areas.
Processing the data in QGIS
Work with coastline layer line feature. There are two coastline layers. One is a polygon, and this has things like islands. The other is a line feature.
- Select the coastline and join the segments using Vector:Join multiple lines. This turns on the editing for this layer. You can then turn off the editing and save the results.
- Convert the coastline to a polygon using Vector:Geometry Tools:Lines to Polygons. This creates a new layer that you can save.
Rename your layers
You need to be able to distinguish between vector layer types, so it makes sense to add an “_a” at the end of the areas you will want to merge in the next step. The coastline polygon layer can be labeled islands.
Merge the layers
I keep the islands separate because they are land, not water.
- se Vector:Data Management Tools: Merge Vector Layers to create a combined water layer. I would suggest having a separate layer for islands since they are land.
- Save this. I either save to a Geopackage (that can also contain styles) or a geojson, which is simple and easy to import into other programs.
Now that you’re done. Next Steps
You should now have a single water area layer with attributes you can query. For labeling rivers, you may want linear river data so that you can place a label in the center of the river.
There will be islands in the water layer. These can be selected with a query and copied to the islands layer.