Higher Education Profiling using Open Source GIS A Primer on OpenStreetMap Data, Mapnik & OpenLayers Oliver O’Brien & Alex Singleton Department of Geography University College London
May 14, 2015
Higher Education Profiling using Open Source GIS
A Primer on OpenStreetMap Data,
Mapnik & OpenLayers
Oliver O’Brien & Alex Singleton
Department of Geography
University College London
Contents
• The Problem• Requirements• The Solution
– OpenStreetMap Data– Mapnik– OpenLayers– Data Sources
• Putting it all Together• The Completed Atlas
The Problem: Presenting the Data
A large amount of education-related spatial information available from various governmental bodies but not in a readily accessible graphical form (i.e. maps) for non-technical users.
• Dept. for Schools, Children and Families• Communities and Local Government• Higher Education Funding Council for England• Higher Education Statistics Agency• Office for National Statistics
“Widening participation” initiatives require effective ways to view such data, to make decisions on target schools and areas.
Requirements I. Straightforward
Standalone GISes
Hard to use (Haklay, 2009a)
Often expensive
Require delivery of data to the client
Requirements I. Straightforward
Web GISes
Slow
Unattractive
Difficult and/or expensive to build
May require delivery of vector data to the client
Requirements I. Straightforward
“Slippy Maps”
Simple to use
Very popular
Simple to build
Powerful API (e.g. Google Maps API)
Requirements II. Accessible
Software installation– Requires time and skill– Constrained by platform
Plug-ins– Generally require a fast computer– Still some platform issues
A solution without installation or plug-ins is most accessible– HTML, CSS, AJAX– PNG images
Requirements III. Self Contained
• No dependencies on third parties with constraints– Ordnance Survey “tile limits”
• The “derived data” problem, Google and Ordnance Survey– Can’t put Ordnance Survey derived data
on a Google Maps “mashup”– Government departments often provide
data that has been geolocated from Ordnance Survey mapping (e.g. using National Grid References)
– Ordnance Survey is being very active at protecting use of its data at the moment
Requirements III. Self Contained
Full control over what’s on the mapGoogle’s colour scheme and branding can be distracting
The Solution: An Education Atlas
Static tiles of choropleth maps•Minimal computer requirements•Scalable
Mapnik•Makes “beautiful” raster maps
OpenStreetMap data•Easily available data source to create background maps•Full control over what is included
OpenLayers•Provides the “slippy map” interface familiar to users•Self-contained
Using OpenStreetMap Data
For a background map to provide context•Will include roads, town names, coastlines•We don’t want all the data – just what we need
Ways to obtain the data•Directly from osm.org as XML, requires converting•Shapefiles produced by CloudMade or Geofabrik
Data quality and completeness•Improving rapidly (Haklay, 2009b)•Now pretty good for England (Reed, 2009)•Can always obtain a very up-to-date dataset
www.openstreetmap.org
Using Mapnik
Data Sources•Shapefiles•PostGIS databases•Direct from OpenStreetMap
TilesCan be configured to systemically create square tiles at different zoom levels for the whole country
www.mapnik.org
“Mapnik is a Free Toolkit for developing mapping applications. Above all Mapnik is about making beautiful maps.” – mapnik.org
Using Mapnik
Stylesheets for the cartographye.g. minor rivers and canals
<Rule> <Filter>[waterway]='river' or [waterway]='canal'</Filter> <MaxScaleDenominator>80000 </MaxScaleDenominator> <LineSymbolizer> <CssParameter name="stroke">#88c <CssParameter name="stroke-width">3 <CssParameter name="stroke-linejoin”>round <CssParameter name="stroke-linecap">round </LineSymbolizer> <TextSymbolizer name="name" face_name="DejaVu Sans Book" size="10" fill="#666" halo_radius="1" placement="line" min_distance="200"/> </Rule>
Using OpenLayers
A way to display maps on a website•Just a simple web browser is needed
Accepts “layers” from many sources•Google Maps•Microsoft Bing, Virtual Earth, Yahoo•ArcGIS 9.3 Mapping Services•Ordnance Survey OpenSpace
More powerful (but more complex) than the popular Google Maps API
www.openlayers.org
Other Data Sources
New Popular Edition Postcoding
Government Data– Combined with UKBORDERS
boundary data, to create choropleths of each educational metric
– Includes the National Pupil Database with postcode, for Key Stage 4 (GCSE) and Key Stage 5 (A-Level)
Putting it all Together: Tile Generation
OpenStreetMap API
Geofabrik Shapefiles PostGIS
Database
Mapnik
Other .gov.uk
Stylesheet
mySQLDatabase
Tiles
DSCF.gov.uk
UKBORDERS
Shapefiles
Putting it all Together: The Website
OpenLayers
NPEMap Postcodes
mySQLDatabase
TilesWeb
Browsers
Bottom: Choropleth (colours)
Middle: Network (B&W)
Top: Schools (pins)
The layers in OpenLayers
The Completed AtlasIDACI in Hampstead vs. Willesden, London
The Completed AtlasA-Level French Popularity in S.E. England
Putting it all Together: The Completed AtlasA-Level Geography Popularity in England
The Completed AtlasOutput Area Classification in Manchester
The Completed AtlasIDACI in Manchester
The Completed AtlasGCSE Performance in Manchester
Problems
• No spatial data for independent schools or further education colleges – hence no A-Level metrics for Manchester
• Tiling process is quite slow and requires ~1GB of storage space for each choropleth set
Next Steps
• Bring in higher education flow data
• Incorporate individual school metrics
References
• Haklay, 2009a: Neo and Paleo GIS – is the difference in the usability culture? http://povesham.wordpress.com/category/gis-usability/
• Haklay, 2009b: OpenStreetMap and OS Master Map – Beyond good enough http://povesham.wordpress.com/2009/07/15/openstreetmap-and-ordnance-survey-master-map-–-beyond-good-enough/
• Reed, 2009: More on OSM Coverage http://tlatet.blogspot.com/2009/08/more-on-osm-coverage.html
Further Information
http://ollie.blogs.splintdev.geog.ucl.ac.uk/