Loading, Styling and Displaying Ordnance Survey Mastermap Data – with Open Source Software



Loading, Styling and Displaying Ordnance Survey Mastermap Data – with Open Source Software

0 0


aging_loaderdemo

My demo of "Loading, Styling and Displaying Ordnance Survey Mastermap Data" at the AGI Northern Group meeting in York, November 2013

On Github archaeogeek / aging_loaderdemo

Loading, Styling and Displaying Ordnance Survey Mastermap Data

with Open Source Software

Jo Cook, Astun Technology / @archaeogeek

Starting Point: compressed gz files of Mastermap Data

End Point: Styled Mapping Data useable as vector (PostGIS or WFS) or raster (WMS)

What tools are we going to use?

Definitely...

  • Python
  • OGR
  • PostGIS

And possibly...

  • QGIS
  • MapServer
  • OpenLayers

How do these fit together?

Step 1

  • Get Loader from GitHub and see the Loader wiki for installation instructions
  • Get Dependencies (GDAL and Python via OSGeo4W, and lxml via easy_install)
  • Get Data
  • Configure the database
  • Configure Loader Easiest to use OSGeo4W to install and run python as it will ensure paths and dependencies are all correct (follow the wiki!)
Switch to XP VM, explain need to download sample Mastermap topography dataset from Ordnance Survey. Unzip to get to gz file. Explain creation of database in pgadmin3 (dbname mastermap username postgres password p0stgres) Edit python/loader.config and change src_dir, and ogr_cmd (note debug flag if problems)

Step 2

Run Loader

python loader.py loader.config

Examine results in database

Run Loader by opening OSGeo4W shell and cding to the loader/python folder (note it can take a while to run). Show in database- should be 6 tables for topolines, topoarea, cartotext plus normal geometry_columns and spatial_ref_sys

Step 3

Connect to PostGIS database using QGIS

Use the mapserver plugin to style data and configure map file, or use the map file included with Loader

Note that for QGIS 2 you need the experimental RT Mapserver Importer (enable experimental plugins) and also need python mapscript installed. Note also that we include a sample map file in the Loader download.

Step 4

View data as WMS in QGIS

With a suitable mapserver and webserver, you can deploy the mastermap data as a WMS. The pre-supplied mapserver map file will provide most of the configuration for this but some depends on your personal setup...

Deep dive into Loader

It's not just for Mastermap- it can be used for Police neighbourhoods, Land Registry, AddressBase, VectorMapLocal, etc, etc! It's not just for PostGIS, it can be used for any ogr-supported output Use gfs and ogr (in Loader.config) for fine-grained control of output format and structure

Contributing

Loader is on Github so we value contributions!

Here's the URL again: https://github.com/AstunTechnology/Loader

Thanks :-)

Find this talk on github https://github.com/archaeogeek/aging_loaderdemo

Jo Cook, Astun Technology / @archaeogeek