A practical example using InaSAFE with OSM data

“In this exercise we will show how we have integrated support for downloading and using OSM data into InaSAFE.”

We mentioned in the overview of exposure data that these data can be easily obtained from OpenStreetMap in InaSAFE. In fact we have built a service that extracts exposure data from OSM, cleans the data, applies standard symbology to it, adds InaSAFE keywords, packs everything up in a zip file for easy use in InaSAFE. The service runs on an internet server InaSAFE.org so requires internet connectivity to use. We have built a client for the service directly into InaSAFE.

You try:

Goal: To be able to add data from OSM and run an analysis with it in InaSAFE.

  • First load the data layers as indicated in the ‘load data’ requirements.
  • Look in your InaSAFE toolbar for the OpenStreetmap Downloader(as shown right).
  • Run the downloader with the options as shown right.
  • After the data have downloaded, run an InaSAFE analysis for each of the newly downloaded layers by using the InaSAFE Impact Function Centric Wizard.
  • Make sure to read the wizard instructions on each step carefully and make the most sensible choices (bearing in mind all the data are already loaded in QGIS).

Check your results:
How many buildings were affected by the flood? What length of roads were affected?

Name Expectation

Load data

Use the QGIS Browser panel to add the following datasets to your QGIS project. From the exercise_data folder: wards.shp, worldpop_25.tif, tandale_imagery.tif From the External data linked below

OSM Downloader

OSM Downloader options

Feature types: - Roads - Buildings Bounding box: Use the ‘drag on map’ option to drag a box around the extents of the sensefly imagery.

More about

As mentioned, you need to have internet connectivity in order to download OSM data. There are also some other limitations to the downloader: It uses the OSM Overpass service which limits the size of the downloads you can do – you might be able to get roads, buildings etc. for a larger town or small city, but expect an error if you request data for too large an area. There are also limits in Overpass that prevent you making multiple concurrent requests from the same IP address in Overpass, so if your request fails, try again, it may help. There are some workarounds for the request size limitation:
- break up your requests into a number of successive, smaller requests and then merge the results using the vector editing functions in QGIS.
- consider an alternative service for obtaining the data. Geofabrik for example Geofabrik is a nice service that provides support for this.
- for power users there is docker-osm GitHub-docker-osm which provides a continuously synchronised mirror of the OSM database for a particular region.
Note: that if you use data from one of the other sources mentioned, you will need to create the styles and InaSAFE keywords for those layers yourself.
When using OpenStreetMap data, you should be careful to attribute it properly

Check your knowledge:

  1. The InaSAFE OSM downloader will help you to download these feature types (choose all that apply):
    1. Roads
    2. Hospitals
    3. Bars
    4. Admin Boundaries
    5. Restaurants
    6. Buildings
    7. Flood prone areas
  2. True or false – OpenStreetMap data are free, there is no need to mention where it came from:
    1. true
    2. false

Further reading:

Click here to download the sample data for the lesson.