Cork City – Street Types

I was reading Alasdair Rae’s street types blog post yesterday and I thought about doing something similar for Ireland. I didn’t have much time today so I said I’d put something quick together for Cork City. Alasdair was lucky that he could use the amazing open data from the UK’s Ordnance Survey. For Ireland, we don’t have anything similar from our national mapping agency but fear not because it’s OpenStreetMap to the rescue. In my humble opinion individuals often spend far too much time trying to get a usable output from overpass-turbo when there’s an easier way. What I did was download the .osm.pbf file for Ireland from Geofabrik. Windows Subsystem for Linux has been a lifesaver since it came along, most of the heavy lifting I can now do through it. The steps I followed are as follows:

1. Download the .osm.pbf file using wget.

Wget Download

Wget Download

2. Install the osmium-tool

Osmium-Tool

Osmium-Tool

 

 

 

 

3.Filter out just the ‘highways’ from the dataset and save it to a new .osm.pbf file

Filter Highways

Filter Highways

 

 

 

 

4. Convert the .osm.pbf file to a new shapefile ( I don’t normally use shapefile but converting to a geopackage was causing some issues in this instance).

Save as Shapefile

Save as Shapefile

 

 

 

 

 

5. Reproject the shapefile to EPSG:2157 (Irish Transverse Mercator).

Reproject to ITM

Reproject to ITM

 

 

 

 

 

 

I could have made this more efficient again by combining some of these actions (such as save as a new shapefile and reprojecting), I did it this way to make the process easier to explain.

Next I brought the dataset into QGIS and extracted an area just for Cork City. The main issue I then has was how to ascertain what road types occur most frequently. I exported the Cork City extract as a CSV and imported it into Excel. I then used a generic formula from the folks at exceljet to extract the last work from the ‘name’ column. I then counted the frequency of the extracted work in a pivot table to get an idea of the types I’d like to use.

Frequency of Road Types

Frequency of Road Types

 

 

 

 

 

 

The last thing I did was to create a new field using an expression to find the various road types in the ‘name’ column from the OSM data. The expression I used is the below:

CASE
	WHEN "name" LIKE '%Road%' then 1
	WHEN "name" LIKE '%Park%' then 2
	WHEN "name" LIKE '%Street%' then 3
	WHEN "name" LIKE '%Avenue%' then 4
	WHEN "name" LIKE '%Court%' then 5
	WHEN "name" LIKE '%Drive%' then 6
	WHEN "name" LIKE '%Hill%' then 7
	WHEN "name" LIKE '%Lawn%' then 8
	WHEN "name" LIKE '%Estate%' then 9
	WHEN "name" LIKE '%Place%' then 10
	WHEN "name" LIKE '%Lane%' then 11
	ELSE 0
END

I then symbolised the data and exported it. The final product is below. Obviously this was a pretty quick and dirty way to do it and if I create an atlas for every major town in Ireland I will use PostGIS which will allow me to count the frequencies and create the new field with ease.

Cork City - Road Types

Cork City – Road Types

Leave a Reply

Your email address will not be published. Required fields are marked *