OpenStreetMap

Dunbar Coummunity Map Data

Posted by Hawkeye on 11 April 2013 in English (English)

From the early days of helping with OSM, I've been interested in being able to summarise in some basic way the geographical features in my area. Whether it's the number of bus stops or if there are more car parks than parks? Following the recent Dunbar mapping party, i started to investigate the options for this type of analysis.

Dunbar mapping party: Dunbar mapping party

Previously, I used QGIS for this type of task and to create maps. This is a great tool for visualising but like Excel for spreadsheets it is difficult to reproduce and reapply analysis to different areas. To improve flexibility and quickly reproduce work on different areas requires a database and scripting. A geodatabase can be linked to QGIS but I faced problems with keeping the database up to date. Scripting can also be done in QGIS via a python command line and GRASS plugin. Certainly python has a lots of powerful features here is a video discussing some of them and I'd like to try this more in the future.

But the most suitable tool for me, is using the statistical language R. I have a basic knowledge of the language and it's friendly syntax appeals to my general unfamiliarity with coding.

The R language has an useful library for accessing OSM data with a great guide to get start. Mix this with a nice GUI called R Studio with support of 'knitr' library which can generate webpages from R code - this makes a simple but powerful tool for summarising OSM data and presenting it on the web. Here is a demo webpage created in R from Dunbar OSM data. This has already paid off in some ways because QGIS osm plugin doesn't support 64bit ids - preventing more recent features from being correctly displayed in QGIS (there is a fix). Whereas R isn't affected by this issue. Here is another great example of what can be done in R with osm data

Building data from Dunbar, Scotland via OSMAR library in R: Dunbar building data

So in summary - I think R is useful for OSM analysis and hopefully we can see more developments and tools based on R being produced. Try it yourself: download R, then R Studio, open R 'markdown' window and paste my code in. Change the co-ordinates at the start of the script to where you live (go to OSM mainpage map and find your location - hit 'permalink' in bottom right hand corner and copy co-ordinates from www address bar into the script). You may have to install packages/libraries using Tools menu.

Are there more car parks or parks in your area? Is this by mistake or design? (okay, it can't answer the latter question)

Dunbar is looking green with plenty more Park than Car park.

  • Parks: 3.7112 hectares or approx 23 football pitches

  • Car parks: 2.0239 hectares or approx 13 football pitches

Location: Belhaven, Eweford Cottages, East Lothian, Scotland, United Kingdom

Leave a comment

Parsed with Markdown

  • Headings

    # Heading
    ## Subheading

  • Unordered list

    * First item
    * Second item

  • Ordered list

    1. First item
    2. Second item

  • Link

    [Text](URL)
  • Image

    ![Alt text](URL)

Login to leave a comment