OSM: Going Back in Time

I’ve been playing around with the full planet file to look at going back in time in OSM. Mainly, this is to look at how Ramani Huria’s data has evolved over time and is all part of extracting more value from Ramani Huria’s data.

I’ve been playing around with the full planet file to look at going back in time in OSM. Mainly, this is to look at how Ramani Huria’s data has evolved over time and is all part of extracting more value from Ramani Huria’s data. This process wasn’t as straightforward as I had hoped, but eventually got there – also, this isn’t to say that this is the only or best way. It’s the one that worked for me!

To do this, you’ll need a pretty hefty machine – I’ve used a Lenovo x230 Intel i5 quad core 2.6ghz, 16gb of ram with over 500gb of free space – This is to deal with the large size of the files that you’ll be downloading. This is all running on Ubuntu 16.04.

Firstly, download the OSM Full History file. I used the uGet download manager to deal with the 10 hour download of a 60gb+ file over 10meg UK broadband connection. Leaving it overnight, I had a full file downloaded and ready for use. Now to set up the machine environment.

The stack is a combination of OSMIUM and OSMconvert. On paper, the OSMIUM tool should be the only tool needed. However, for reasons that I’ll come to, it didn’t work, so I found a workaround.

OSMconvert is easily installed:

sudo apt-get install osmctools

This installs OSMconvert other useful OSM manipulation tools. Installing OSMIUM is slightly more complicated and needs to be done through compiling by source.

Firstly, install LibOSMIUM – I found not installing the header files meant that compilation of OSMIUM proper would fail. Then use the OSMIUM docs to install OSMIUM. While there is a package included in Ubuntu for OSMIUM, it’s of a previous version which doesn’t allow the splitting of data by a timeframe. Now things should be set up and ready for pulling data out.

Dar es Salaam being the city of interest, has the bounding box (38.9813,-7.2,39.65,-6.45) – you’d replace these with the South West, North West point coordinates of your place of interest, and use OSMconvert, in the form:

$ osmcovert history_filename bounding_box o=output_filename

osmconvert history-170206.osm.pbf -b=38.9813,-7.2,39.65,-6.45 -o=clipped_dar_history-170206.pbf

This clips the full history file to that bounding box. It will take a bit of time. Now we can use OSMIUM to pull out the data from a date of our choice in the form:

$ osmium time-filter clipped_history_filename timestamp -o output_filename

osmium time-filter clipped_dar_history-170206.pbf 2011-09-06T00:00:00Z -o clipped_dar_history-170206-06092011.pbf 

This gives a nicely formatted .pbf file that can be used in QGIS (drag and drop), POSTGIS or anything else. As the contrast below illuminates!

tandale_01082011
Tandale, Dar es Salaam, Tanzania – 1st August 2011
tandale_2017_lowres
Tandale, Dar es Salaam, Tanzania – 13th February 2017

Enjoy travelling back in time!

All map data © OpenStreetMap contributors.

Building Heights in Dar es Salaam

I first went to Dar es Salaam in 2011, there were a few skyscrapers adorning the city’s skyline, now they’re everywhere! Sitting on a rooftop bar in the center of the city, it’s a mass of cranes and pristine new buildings.

Alongside this rapid growth, Ramani Huria has been collecting a lot of data but a lot of it doesn’t get rendered by the default OSM styles… so I’ve dug into the data and created a map of the different floors across the city.

This interactive map allows you to explore where the tallest buildings are in the city, but in displaying the data in this way, also allows for the densest, unplanned and informal areas of the city to become very clear.

There is still some way to go though – in Dar es Salaam there are around 750,000 buildings, with roughly 220,000 (~30%) having been surveyed by the Ramani Huria team and given an appropriate attribute. Ramani Huria has focused its efforts in the urban centres of Dar es Salaam, where most of the multi-story buildings are to be found. But, still a lot more to be covered towards Bagomoyo and Morogoro.

Hat tip to Harry Wood who’s advice and guidance pointed me in the right direction – a more technical blog post and more details of other challenges around correctness of tagging but that’s for another post – now to look at Floor Spaces Indices…!

Starting Ramani Huria – Mapping The Flood Prone Areas In Dar es Salaam

Four years ago, in August 2011 I was fortunate to manage the community mapping of Tandale. It was an experience that irrevocably changed my professional direction and interests. Over a month I trained and worked alongside brilliant students and community members, who were all focused on getting an open map of Tandale, something that had never been accomplished previously. When it was done, the reception across civil society and government was positive and intentions on scaling the pilot to the city were mooted but for one reason or another it never quite made it. Then in December, floods hit the city. In dense informal urban environments such as Tandale these floods are fatal and dramatically change the landscape as well as causing mass damage to survivor’s livelihoods and assets. Mitigating these floods are hard – where do you start in the fastest growing city in Africa? The population as of the 2012 census currently stands of 5 million, with projections showing it could grow to 10 million by 2030.

This rapid and unplanned urbanisation is in part the cause of flooding: the infrastructure with which to cope with high rainfall, such as drains and culverts, were not built alongside residential dwellings. This is especially acute in the unplanned, informal urban settlements where a majority of Dar es Salaam’s residents reside. The theory here is quite simple: If that if you can identify where it floods, you can either install or upgrade infrastructure to ameliorate the situation for residents. Unpacking this, the crux of the issue falls to two main points, governance and data.

Ramani Huria – Swahili for “Open Mapping” – is a operationalization of this theory of change. In March 2015, a coalition from across Tanzanian society, composed of the City Council of Dar es Salaam, the Tanzanian Commission for Science and Technology (COSTECH – under the Ministry of Science, Communication and Technology), the University of Dar es Salaam, Ardhi University, Buni Innovation Hub supported by the Red Cross and World Bank supported the inception of Ramani Huria, with the goal of mapping flood prone areas in Dar es Salaam, making this data openly available and supporting the use of this data into government where decisions can be made to mitigate flooding.

Mapping Phases
Mapping Phases

It is a far cry from 2011 where just mapping the ward of Tandale was a large task. Ramani Huria consists of a pilot phase and four subsequent phases. To pilot, the wards Ndugumbi, Tandale and Mchikichini, with a combined population of over 100,000 residents were mapped in series. This process combined 15 students matched with community members, leading to maps of all features within that community. This information, focusing on drainage and water ways, is critically needed to help understand and locate flood prone areas; this is high priority in Dar es Salaam due to the damage that annual floods wreak upon the city and its residents. In this piloting phase, conducted from March to the end of June these three wards were mapped, in part to generate the data that will generate flood inundation models and exposure layers but also to pilot the data model and gel the team, prior to Phase One.

Scale Up Workshop
Scale Up Workshop – https://www.facebook.com/ramanihuria

Phase one on paper is quite simple. Take 150 students from the University of Dar es Salaam’s Department of Geography and Ardhi University’s School of Urban and Regional Planning on industrial training, hold an inception workshop, deploy this contingent across six wards and work with community members to replicate the pilots, but running in parallel. At the time of writing, mapping is ongoing in six communities: Msasani, Keko, Makumbusho, Mabibo, Makurumla and Mburahati. According to the 2012 NBS census, these wards have a combined population of over 280,000 residents. Phase one was kicked off on the 6th of July and will run until the 14th of August.

Field Survey - https://www.facebook.com/ramanihuria
Field Survey – https://www.facebook.com/ramanihuria

Phases Two and Three, will integrate community volunteers from the Red Cross, these volunteers are committed to creating community level resilience plans. These plans will use the data produced by the mapping to create resident evacuation routes and aid Ward Exective Officers with planning decisions among many other uses. Additionally, with embedded long term volunteers monitoring change in their wards, this will hopefully result in detailed up-to-date maps in rapidly changing urban areas.

InaSAFE Training - https://www.facebook.com/ramanihuria
InaSAFE Training – https://www.facebook.com/ramanihuria

Phase Four unfortunately sees the students depart from the project, due to their graduation. With a remaining contingent of around 30 mappers, mapping will continue until February 2016. These phases cover the data component, consequently alongside these phases are dedicated training events aimed at building capacity to use and deploy this data in real world situations. On the 20th July the first such workshop series took place, with representatives from the Prime Minister’s Office for Disaster Management Department being trained in spatial analysis in QGIS and risk modelling using the QGIS plugin InaSAFE. A series of these workshops will take place, placing the data into the hands of those responsible for the city.

While this is ongoing in Dar es Saalam, you could get involved wherever you are in the world, through the Missing Maps project. Missing Maps is a collaboration between the Red Cross, Doctors Without Borders and Humanitarian OpenStreetMap Team, aimed at digitising “the most vulnerable places in the developing world”, but primarily do so by crowdsourcing the digitisation of aerial imagery. At the moment, there are three tasks for Dar es Salaam:

By helping digitise the buildings and roads, using the recent drone and aerial imagery, the process of mapping is faster, allowing the community mappers to focus on the detail of flood data. Additionally, the data from Ramani Huria is all placed into OpenStreetMap, its code is on Github and content available from Flickr and Facebook, all with an open licence. Please get involved!

 

Written on a plane somewhere between Tanzania and the United Kingdom

GISRUK 2013

On the 3rd to the  5th of April I attended GISRUK (Geospatial Information Research in the United Kingdom) to give a paper on Community Mapping as a Socio-Technical Work Domain. In keeping with Christoph Kinkeldey‘s love of 1990s pop stars Vanilla Ice made a second slide appearance, leveraging the fact it’s a very technical academic title. In short I’m using Cognitive Work Analysis (CWA) to create a structural framework to assess the quality (currently defined by ISO 19113:Geographic Quality Principles – well worth a read…) where there is no comparative dataset.

CWA is used to assess the design space in which a system exists, not the system itself. In taking a holistic view and not enforcing constraints on the system you can understand what components and physical objects you would need to achieve the values of the system and vice-versa. In future iterations I’m going to get past first base and look at decision trees and strategic trees to work out how to establish the quality of volunteered geographic data without a comparative dataset. Building quality analysis into day one, as opposed to being an after thought.

Written and submitted from Home (52.962339,-1.173566)

 

Usability Of OSM’s ‘Toolkit’ In Community Mapping

This blog post isn’t a formal evaluation of the usability of OSM’s software or the equipment used for mapping. It is not meant to attack particular software; The software and implementation of OSM deserves many medals with equal amount of recognition.

This post is about things I noticed while mapping in Tandale, there is no statistical analysis, I have no dependent or independent variables, it’s based mainly around anecdotes and conversations with people. Though this doesn’t exist as a formal ethnography, it could serve for some useful pointers in future.

JOSM

As we had netbooks with a small-ish (11″) screen-size and a trackpad, mice are essential for mappers getting started. In month spent in Tandale the designated editors have become JOSM gods with the majority of students and community members having fair literacy within JOSM’s processes. However when starting, the software was made accessible to the mappers purely through using a mouse. Most of the mappers were familiar with mice, whereas a trackpad was a piece of technology that wasn’t commonly used.

Conflicts commonly occurred within JOSM, in that groups where editing and uploading areas that they had mapped independently. This was difficult to control at first, as we had started with a blank slate, however boundaries of the sub-wards was relatively well known and demarcated by physical boundaries. Regardless groups wandered into areas which weren’t theirs to map. With the division of labour, in that roughly half were mappers undertaking the bulk of the surveying and with the others editing. When conflicts occurred the process was occasionally esoteric, especially if the group in question had been editing for a while.

To counter this I requested that each of the different sub-ward teams follow the mantra of save, upload and download often. Unfortunately this, on many an occasion, fell on deaf ears. This just meant conflicts were a laborious process, how could they be made better? Also JOSM’s autosave feature was a godsend, inevitably something would crash, causing people to start again.

Within the final presentation to the wider community and stakeholders, one of the points raised was incorrect spelling. There is autocomplete in JOSM, however it seems that if a spelling mistake got in first, like ‘Madrasah’ (an Islamic school, with debate on its correct spelling anyway) this would filter down, with the new mappers believing that the system is right. This would start adding clunky bits of software onto something that was never designed for spelling correction, but should plugins be created to improve this?

OSM Tagging

Due to the informal economy within the slums formal medical advice and dispensing is very rare. The community-at-large simply cannot afford ‘professional’ medical care. This has led to ‘dawa’ – medicine – shops dispensing everything from medical advice to prescription medication. Formally defining these structures into OSM is difficult, we could just create custom presets, it’s something done within Map Kibera and Map Mathare.

The issue here is that we are using the same ‘custom’ presets repeatedly. It surely would be better to include the commonly used attributes (common when mapping in environments such as Tandale/Mathare/Kibera) in the JOSM package itself? Is this feasible?

Satellite Image Tracing

One of the experiments that ‘failed’ was the tracing of satellite imagery. Bing were very kind in releasing their imagery to the OSM community to derive data, and our initial idea was to derive building outlines from this imagery. Initially it was perceived that tracing went well, some buildings weren’t quite perpendicular but using JOSM’s built in ‘q’ function fixed this. When map completeness was approaching, validation errors were caught informing that pathways were going through buildings and vice-versa. There are three explanations for this;

  1. The GPS has recorded an inaccurate position, i.e. path through the environment due to the accuracy being imprecise. (Technology Error)
  2. When editing the editor has generalised a GPS position or incorrectly mapped a building. (Human Error)
  3. The imagery is not rectified properly, or some error exists in the processing/the quality of a ‘high’ enough quality with which to derive information. (Human and Technology Errors)

These factors are a combination of human and technical problems, in this case I believe it is a culmination of each of the factors. Some of them, especially with image quality and GPS accuracy would presumably need some sort of best practice to be implemented. Other sources of human error in the editing process are harder problems, especially without a comparable dataset, this is a more open ended problem.

Rendering

When I joined OSM I was a student in a foreign city, with no map with which to explore with. A massively pro open source friend recommended the OSM project. I already had a GPS from my time working at a camping store during summer holidays  so it was a match made in heaven really. My first edit was of the D400 road from Nancy to Lunéville around 2007/8 then I set to work in the area.

The community was very small and so, presumably was the power of the servers; it would take a few days for anything to be rendered on the OSM homepage. Now something uploaded can take anything from five minutes to an hour. The server administrators deserve more recognition in their services, so if you meet them, buy them a drink – they deserve it.

Summary

In summary, I believe that the tools we use in OSM are great, none of what I’ve written is a slant at a particular software or person. I believe that we should however consider certain points about widening access to the software in making it more usable. I also welcome comments below!

Written and submitted from the World Bank Offices, Washington DC (38.899, -77.04256)

Tandale One Month On

After an initial mapping phase in Tandale we went back. We were group composed of World Bank sector employees across ICT (my new employers), Education and Urban with students of Ardhi University, guided by the Tandale ward research officer. We started off going to Tandale Market.

The market in Tandale is very important for the economy of Dar Es Salaam, due to it being the only large scale transit point for fresh fruit, vegetables and grain/rice into Dar. The market has grown in the month since I was last there. A covered extension to one of the buildings has been installed, albeit in a very informal manner. A market place that was bursting out at the seams before is now starting to encroach, reclaiming drains and irrigation ditches.

After the market we met the Sokoni sub-ward officer on a follow up to the tour he gave me last month. Although the sub-ward was seeming preparing for a celebrity wedding with music and dancing he kindly gave us time for an interview. After this conversation developed to what needs to be mapped next. One of these themes would be private toilets, inside housing; the video above articulates this.

Finally we visited the open space in-between Sokoni and Mharitan, this space is used as a dumping area for solid waste, open deification and personal washing. Bar the public health and water issues (malaria, cholera and typhoid among many other potential diseases) children are playing freely on this land, through no other open space in which to play. The land is also being reclaimed through new housing developments. Something regarding solid waste collection needs to be implemented soon, before there is physically no more space in which to dump rubbish.

Written and submitted from the Hotel Kilimanjaro, Dar Es Salaam ( -6.8173, 39.2931)

Understanding Landuse In Tandale

Tandale Landuse September 2011

Towards the end of the mapping phase landuse was demarcated, the results are above. This isn’t representative of the official (the city council) view of landuse this represents landuse as it was observed on the ground. If people wish to download the shapefile it is here. As this is Open Street Map you can also just download data and use it freely under the terms of the OSM licence.

When presenting the project to the community/being questioned why a bunch of people are wandering around a slum with GPS’ the questions were always along the same lines. “Are you mapping land boundaries to prove property ownership? … No? … Why are you here then?”. This then led us to explain and pitch the project to them. However it illustrates people’s concerns; quite a lot of housing in the slum is informal, with precedents of slum improvements destroying homes in the name of progress, regardless of its merits and pitfalls. However this is a story for another time.

From this why map landuse if not for property demarcation? We have access to official population data, this combined with our landuse data we can then understand the provision of services across Tandale. Within the residential areas we have the building blocks to understand not just where the toilets are, but the potential average of each person using that toilet in that area. The same methodological approach can apply to water access points, shops and butchers; any point of interest basically.

Understanding the reality of the ground situation, a ground truth if you will is important. While data is collected the reliability and time since collection are questionable in developed societies where the demographic shifts over decades like the UK. Dar Es Salaam is the 3rd fastest growing city in Africa and 10th fastest in the world. The majority of people contributing to this influx are moving from rural areas to the city. The economics of this mean they gravitate to slums like Tandale. Land can be reclaimed and houses built as rapidly as they fall, simply because people need a place to live.

The increasing population puts enough of a strain on the existing infrastructure, this situation will not resolve itself organically. For example the market of Tandale acts as a staging area for majority of fresh fruit, vegetables, grain and rice. The supply chain starts outside Dar Es Salaam, in areas like Bagamoyo and Morogoro and shipped to the one market. The roads are a mixture of paved and unpaved which on occasion grind to a standstill. Using the data collected we can now start to ask questions like ‘How do we keep the supply chain going?’, ‘How many people in residential areas have access to toilets?’. It’s not quite “open data now” but it’s close and getting closer.

Written and submitted from Broadway Cinéma, Nottingham, UK (52.9540,1.1437)