SlideShare ist ein Scribd-Unternehmen logo
1 von 36
Downloaden Sie, um offline zu lesen
5/31/2011




   Consuming Ordnance
Survey Open Data with Open
     Source Software




         Matt Walker and Jo Cook
The Grand Plan
To go from this:
The Grand Plan
And this:
The Grand Plan
To this:
The Grand Plan



             In 2 Hours!
Running Order
1. Download Ordnance Survey Open Data and Mastermap
   Sample
2. Prepare it for use with open source tools and some clever
   python scripts
3. Check it all works
4. Display on a pretty openlayers map


                          Simples!
Getting Started
Boot the liveDVD and login with the username user and the
password user

Welcome to XUbuntu!

Click on the "Home" folder on your desktop to see where your
files will be stored
Getting Started
Change the keyboard settings from US to UK by right-clicking
the US flag in the top-right corner of the screen and clicking the
"Add" button next to "Keyboard Layouts". Expand "United
Kingdom" and choose "Extended win-keys" and hit "OK".
Getting Started
We need to update one piece of software on the disk.

Open Applications (menu) -> System -> Synaptic Package
Manager

Click the "reload" button to reload the list of available
repositories.
Getting Started
In the "quick search" box, search for gdal-bin.

We are looking for version 1.8.
Getting Started
Tick the box next to gdal-bin and choose "Mark for Upgrade".
Click the "Apply" button and agree to the dialogue about
installing additional packages.
Getting Started
First we need to get the data, and the scripts and tools that
we'll use to work with it.

In firefox download into your "Downloads" folder:
http://download.astuntechnology.com/public/Workshop2011.zip

Extract Workshop2011.zip by right-clicking it and choosing
"open with archive manager", and save in the "Downloads"
folder.
Getting Started
Then we need to download some sample mastermap data from
the Ordnance Survey, as their license prevents us from
distributing it.

In firefox, go to:
http://www.ordnancesurvey.co.uk/oswebsite/products/try-
now/sample-data.html
and download the OS MasterMap Topography Layer zip file

This will be saved in your "Downloads" folder. Right-click it and
choose "Open with Archive Manager" and extract it to the
folder:
/home/user/Downloads/Workshop2011/Data/OS MasterMap
Getting Started
Check the permissions on both the Workshop2011 folder, the
_mapserverconfig folder, and the .map files.

In File Manager, right-click the folder or file and choose
"Properties". Choose the "Permissions" tab and ensure that it
is set to read-only for the "Others" group.

If presented with a dialogue asking you to make these changes
to sub-folders and files, agree to it.
Creating the database
We are going to create a spatial database to hold the
MasterMap and Vector-based Open Data.

Open pgadmin3 from Geospatial (menu) -> Databases -> PG
Admin III and expand the "Servers" list in the left-hand window.
Double-click on "localhost" as that represents the local
computer.

Expand "localhost" and right-click on "Databases" to create a
new database.

This should be called mapbase
The owner should be user
The template should be template_postgis
Creating the database




Click OK to create the database
Creating the database
Next, we need to create some schemas in the database to hold
the different types of data.

Select the SQL window, choose the "open file" dialog and then
browse to the file:
/home/user/Downloads/Workshop2011/Software/create-
schemas.sql

Then click the "Execute Query" button to run the SQL
Creating the database
Loading the Ordnance Survey Open Data
In File Manager navigate to
/home/user/Downloads/workshop2011/Software

Make the script load-os-opendata.sh executable by right
clicking the file in File Manager and in the Permissions tab
checking "Allow this file to run as a program" and click OK

Open a terminal window and type the following:

cd /home/user/Downloads/Workshop2011/Software
 ./load-os-opendata.sh

This might take a while... so we'll take a look at what data
we've included:
http://www.ordnancesurvey.co.uk/oswebsite/products/os-
opendata.html
Loading the Ordnance Survey Open Data
Loading the Ordnance Survey Mastermap Data
This requires the same process as before, so navigate
to /home/user/Downloads/workshop2011/Software

Make the script load-os-mastermap.sh executable by
right clicking the file in File Manager and in the
Permissions tab checking "Allow this file to run as a
program" and click OK

Open a terminal window and type the following:

cd /home/user/Downloads/Workshop2011/Software
 ./load-os-mastermap.sh

This will also take a while... so we'll take a look at the
tools we're using at http://www.gdal.org/
Raster Data Preparation
 As downloaded from the Ordnance Survey, the raster
 data needs some preparation to make it useable in
 mapserver (or any gis).

 Firstly, in File Manager, navigate to
 /home/user/Downloads/Workshop2011/Data and for
 each of the folders below, navigate into the named folder
 and move the georeferencing files, or .tfw files from
 ./data/georeferencing files/tfw to ./data, where the tifs
 are.

 Do this for each of the following folders:
 • 1 250 000 Scale Colour Raster
 • MiniScale
 • OS Street View
 • OS VectorMap District (Raster)
Raster Data Preparation
 To make the multi-tile raster datasets, such as OS
 VectorMap District (Raster) and OS Street View work
 more efficiently in mapserver, we need to create a
 tileindex for each dataset.

 This is a shapefile of polygons representing the
 boundaries of each raster tile, with an attribute
 location recording the relative path to the tile.
Raster Data Preparation
 In File Manager, navigate
 to /home/user/Downloads/Workshop2011, right-click data
 and choose "open terminal here".

 Type:
 gdaltindex "OS VectorMap District
 (Raster)/data/osvectormapdistrict.shp" "OS VectorMap
 District (Raster)/data/"*.tif

 Repeat for StreetView:
 gdaltindex "OS Street View/data/osstreetview.shp" "OS
 Street View/data/"*.tif

 Top tip: use the tab key to autocomplete directory
 and file names at the command line
Testing your map file
You can view your map file directly in a web browser using the
following URL:

http://localhost/cgi-bin/mapserv?
map=/home/user/Downloads/Workshop2011/_MapserverConfig
/OSOpendata.map&mode=map&layers=[layername]

Substitute the name of a layer from your OSOpendata.map file
(or the included map files)- remembering that it is case
sensitive.

Recall that some layers have a minimum and maximum
scale at which they display. You can comment out these in
the map file for testing purposes, using the # symbol.
OH NO! It's all gone wrong!

Errors will be shown in the browser window or in the log files
in /var/www/temp.
And finally...
Once the map file is working correctly, it's time to see the
results of all your hard work in a shiny OpenLayers map.

Open a command prompt and type the following:

sudo cp
/home/user/Downloads/Workshop2011/Software/OpenLaye
rs/opendatamap.htm /var/www/opendatamap.htm

Finally, view the map in the browser at

http://localhost/opendatamap.htm
Extra Credit: Viewing the Data in Quantum GIS
Now we have our vector data loaded into PostgreSQL, we
can view it in any standards-compliant desktop GIS.

Open Quantum GIS from the Geospatial (menu) -> Desktop
GIS -> Quantum GIS

Go to Layer (menu) -> Add PostGIS Layer, then click "new"
and fill in the following:
 • Name (can be anything)
 • Host- Localhost
 • Database- mapbase
 • Username- user
 • Password - user
 • Port 5432
Tick the "save username" and "save password" boxes and
test the connection
Viewing the Vector Data in Quantum GIS
Viewing the Vector Data in Quantum GIS
 Click on the "Connect" button to make a connection to
 the database. In the main window, expand the schemas
 and choose a table (or tables) to load, and click "Add"
Viewing the WMS in Quantum GIS
  We can view our styled data as image data (not
  clickable) in Quantum GIS.

  Choose Layer (menu) -> Add WMS Layer. In the Layers
  tab, click "New" and give the server a name (like
  mapserver) and put in the following address as the URL:

  http://localhost/cgi-bin/mapserv?
  map=/home/user/Downloads/Workshop2011/_Mapserver
  Config/OSOpendata.map

  Leave the username and password blank, and click
  "OK".
Viewing the WMS in Quantum GIS
Viewing the WMS in Quantum GIS
  Click "Connect" to see the available layer groups from
  your map file. Expand these to see the available layers,
  and choose "Add" to add these to your map.
We're Done!




              Yay!
This would not have been possible without...

                                OpenLayers
5/31/2011




Thank You!




 Matt Walker and Jo Cook

Weitere ähnliche Inhalte

Ähnlich wie Consuming and Publishing Ordnance Survey Open Data with Open Source Software

Mac Os X V10.3 “Panther”
Mac Os X V10.3 “Panther”Mac Os X V10.3 “Panther”
Mac Os X V10.3 “Panther”Mary Jane Cuizon
 
InstallationGuide.pdf
InstallationGuide.pdfInstallationGuide.pdf
InstallationGuide.pdfsahirzakaria
 
Soil and Water Assessment Tool Procedure
Soil and Water Assessment Tool ProcedureSoil and Water Assessment Tool Procedure
Soil and Water Assessment Tool ProcedureKEFA FEYE
 
(A1)_RWS_Customization_WORKSAMPLE
(A1)_RWS_Customization_WORKSAMPLE(A1)_RWS_Customization_WORKSAMPLE
(A1)_RWS_Customization_WORKSAMPLEAngel Marckwordt
 
Installing 12c R1 database on oracle linux
Installing 12c R1 database on oracle linuxInstalling 12c R1 database on oracle linux
Installing 12c R1 database on oracle linuxAnar Godjaev
 
841- Advanced Computer ForensicsUnix Forensics LabDue Date.docx
841- Advanced Computer ForensicsUnix Forensics LabDue Date.docx841- Advanced Computer ForensicsUnix Forensics LabDue Date.docx
841- Advanced Computer ForensicsUnix Forensics LabDue Date.docxevonnehoggarth79783
 
LogMan 8.0 U S E R G U I D E
LogMan 8.0  U S E R  G U I D ELogMan 8.0  U S E R  G U I D E
LogMan 8.0 U S E R G U I D ENgo Hung Long
 
DevHelper Installation and User Documentation
DevHelper Installation and User DocumentationDevHelper Installation and User Documentation
DevHelper Installation and User DocumentationPatrick O'Conor
 
My First Hadoop Program !!!
My First Hadoop Program !!!My First Hadoop Program !!!
My First Hadoop Program !!!Ayapparaj SKS
 
2D CAD Module by gonzalochris
2D CAD Module by gonzalochris2D CAD Module by gonzalochris
2D CAD Module by gonzalochrisChris Gonzalo
 
Assignment 1 MapReduce With Hadoop
Assignment 1  MapReduce With HadoopAssignment 1  MapReduce With Hadoop
Assignment 1 MapReduce With HadoopAllison Thompson
 
OpenNMS - My Notes
OpenNMS - My NotesOpenNMS - My Notes
OpenNMS - My Notesashrawi92
 
Making%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20WindowsMaking%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20Windowstutorialsruby
 
Making%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20WindowsMaking%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20Windowstutorialsruby
 

Ähnlich wie Consuming and Publishing Ordnance Survey Open Data with Open Source Software (20)

manual global mapper
manual global mappermanual global mapper
manual global mapper
 
Mac O S X V10
Mac  O S  X V10Mac  O S  X V10
Mac O S X V10
 
Mac Os X V10.3 “Panther”
Mac Os X V10.3 “Panther”Mac Os X V10.3 “Panther”
Mac Os X V10.3 “Panther”
 
InstallationGuide.pdf
InstallationGuide.pdfInstallationGuide.pdf
InstallationGuide.pdf
 
Soil and Water Assessment Tool Procedure
Soil and Water Assessment Tool ProcedureSoil and Water Assessment Tool Procedure
Soil and Water Assessment Tool Procedure
 
154090896 installation-of-oracle-database-12c
154090896 installation-of-oracle-database-12c154090896 installation-of-oracle-database-12c
154090896 installation-of-oracle-database-12c
 
(A1)_RWS_Customization_WORKSAMPLE
(A1)_RWS_Customization_WORKSAMPLE(A1)_RWS_Customization_WORKSAMPLE
(A1)_RWS_Customization_WORKSAMPLE
 
Installing 12c R1 database on oracle linux
Installing 12c R1 database on oracle linuxInstalling 12c R1 database on oracle linux
Installing 12c R1 database on oracle linux
 
841- Advanced Computer ForensicsUnix Forensics LabDue Date.docx
841- Advanced Computer ForensicsUnix Forensics LabDue Date.docx841- Advanced Computer ForensicsUnix Forensics LabDue Date.docx
841- Advanced Computer ForensicsUnix Forensics LabDue Date.docx
 
LogMan 8.0 U S E R G U I D E
LogMan 8.0  U S E R  G U I D ELogMan 8.0  U S E R  G U I D E
LogMan 8.0 U S E R G U I D E
 
DevHelper Installation and User Documentation
DevHelper Installation and User DocumentationDevHelper Installation and User Documentation
DevHelper Installation and User Documentation
 
My First Hadoop Program !!!
My First Hadoop Program !!!My First Hadoop Program !!!
My First Hadoop Program !!!
 
2D CAD Module by gonzalochris
2D CAD Module by gonzalochris2D CAD Module by gonzalochris
2D CAD Module by gonzalochris
 
Module 2 b_win 7
Module 2 b_win 7Module 2 b_win 7
Module 2 b_win 7
 
Assignment 1 MapReduce With Hadoop
Assignment 1  MapReduce With HadoopAssignment 1  MapReduce With Hadoop
Assignment 1 MapReduce With Hadoop
 
Installing JVM
Installing JVMInstalling JVM
Installing JVM
 
OpenNMS - My Notes
OpenNMS - My NotesOpenNMS - My Notes
OpenNMS - My Notes
 
Saving File As Plot File
Saving File As Plot FileSaving File As Plot File
Saving File As Plot File
 
Making%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20WindowsMaking%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20Windows
 
Making%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20WindowsMaking%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20Windows
 

Mehr von Joanne Cook

Intro to the Open Source Geospatial Foundation
Intro to the Open Source Geospatial FoundationIntro to the Open Source Geospatial Foundation
Intro to the Open Source Geospatial FoundationJoanne Cook
 
Intro to Quantum GIS Desktop GIS
Intro to Quantum GIS Desktop GISIntro to Quantum GIS Desktop GIS
Intro to Quantum GIS Desktop GISJoanne Cook
 
Introduction to OSGeo:UK
Introduction to OSGeo:UKIntroduction to OSGeo:UK
Introduction to OSGeo:UKJoanne Cook
 
Open Source and Open Data
Open Source and Open DataOpen Source and Open Data
Open Source and Open DataJoanne Cook
 
AGI 2010: It's all one big opportunity
AGI 2010: It's all one big opportunityAGI 2010: It's all one big opportunity
AGI 2010: It's all one big opportunityJoanne Cook
 
Worskhop OSGIS2010
Worskhop OSGIS2010Worskhop OSGIS2010
Worskhop OSGIS2010Joanne Cook
 
Osgis 2010 notes
Osgis 2010 notesOsgis 2010 notes
Osgis 2010 notesJoanne Cook
 
Worskhop Leicester 2010
Worskhop Leicester 2010Worskhop Leicester 2010
Worskhop Leicester 2010Joanne Cook
 
Leicester 2010 notes
Leicester 2010 notesLeicester 2010 notes
Leicester 2010 notesJoanne Cook
 
Lancaster University GIS Course 2010
Lancaster University GIS Course 2010Lancaster University GIS Course 2010
Lancaster University GIS Course 2010Joanne Cook
 
Databases and web mapping the Open Source way
Databases and web mapping the Open Source wayDatabases and web mapping the Open Source way
Databases and web mapping the Open Source wayJoanne Cook
 
How archaeologists use GIS
How archaeologists use GISHow archaeologists use GIS
How archaeologists use GISJoanne Cook
 
The Impact of Open Source
The Impact of Open SourceThe Impact of Open Source
The Impact of Open SourceJoanne Cook
 
Open Source GIS for Local Government
Open Source GIS for Local GovernmentOpen Source GIS for Local Government
Open Source GIS for Local GovernmentJoanne Cook
 
Foss4g Portable Gis
Foss4g Portable GisFoss4g Portable Gis
Foss4g Portable GisJoanne Cook
 

Mehr von Joanne Cook (20)

Intro to the Open Source Geospatial Foundation
Intro to the Open Source Geospatial FoundationIntro to the Open Source Geospatial Foundation
Intro to the Open Source Geospatial Foundation
 
Intro to Quantum GIS Desktop GIS
Intro to Quantum GIS Desktop GISIntro to Quantum GIS Desktop GIS
Intro to Quantum GIS Desktop GIS
 
Introduction to OSGeo:UK
Introduction to OSGeo:UKIntroduction to OSGeo:UK
Introduction to OSGeo:UK
 
Open Source and Open Data
Open Source and Open DataOpen Source and Open Data
Open Source and Open Data
 
AGI 2010 Notes
AGI 2010 NotesAGI 2010 Notes
AGI 2010 Notes
 
AGI 2010: It's all one big opportunity
AGI 2010: It's all one big opportunityAGI 2010: It's all one big opportunity
AGI 2010: It's all one big opportunity
 
Worskhop OSGIS2010
Worskhop OSGIS2010Worskhop OSGIS2010
Worskhop OSGIS2010
 
Osgis 2010 notes
Osgis 2010 notesOsgis 2010 notes
Osgis 2010 notes
 
Worskhop Leicester 2010
Worskhop Leicester 2010Worskhop Leicester 2010
Worskhop Leicester 2010
 
Leicester 2010 notes
Leicester 2010 notesLeicester 2010 notes
Leicester 2010 notes
 
Lancaster University GIS Course 2010
Lancaster University GIS Course 2010Lancaster University GIS Course 2010
Lancaster University GIS Course 2010
 
Databases and web mapping the Open Source way
Databases and web mapping the Open Source wayDatabases and web mapping the Open Source way
Databases and web mapping the Open Source way
 
How archaeologists use GIS
How archaeologists use GISHow archaeologists use GIS
How archaeologists use GIS
 
The Impact of Open Source
The Impact of Open SourceThe Impact of Open Source
The Impact of Open Source
 
Open Source GIS for Local Government
Open Source GIS for Local GovernmentOpen Source GIS for Local Government
Open Source GIS for Local Government
 
Bcs Talk Notes
Bcs Talk NotesBcs Talk Notes
Bcs Talk Notes
 
Gateway Seminar
Gateway SeminarGateway Seminar
Gateway Seminar
 
Foss4g Portable Gis
Foss4g Portable GisFoss4g Portable Gis
Foss4g Portable Gis
 
Bcs Talk Notes
Bcs Talk NotesBcs Talk Notes
Bcs Talk Notes
 
Agi 2008
Agi 2008Agi 2008
Agi 2008
 

Kürzlich hochgeladen

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Kürzlich hochgeladen (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

Consuming and Publishing Ordnance Survey Open Data with Open Source Software

  • 1. 5/31/2011 Consuming Ordnance Survey Open Data with Open Source Software Matt Walker and Jo Cook
  • 2. The Grand Plan To go from this:
  • 5. The Grand Plan In 2 Hours!
  • 6. Running Order 1. Download Ordnance Survey Open Data and Mastermap Sample 2. Prepare it for use with open source tools and some clever python scripts 3. Check it all works 4. Display on a pretty openlayers map Simples!
  • 7. Getting Started Boot the liveDVD and login with the username user and the password user Welcome to XUbuntu! Click on the "Home" folder on your desktop to see where your files will be stored
  • 8. Getting Started Change the keyboard settings from US to UK by right-clicking the US flag in the top-right corner of the screen and clicking the "Add" button next to "Keyboard Layouts". Expand "United Kingdom" and choose "Extended win-keys" and hit "OK".
  • 9. Getting Started We need to update one piece of software on the disk. Open Applications (menu) -> System -> Synaptic Package Manager Click the "reload" button to reload the list of available repositories.
  • 10. Getting Started In the "quick search" box, search for gdal-bin. We are looking for version 1.8.
  • 11. Getting Started Tick the box next to gdal-bin and choose "Mark for Upgrade". Click the "Apply" button and agree to the dialogue about installing additional packages.
  • 12. Getting Started First we need to get the data, and the scripts and tools that we'll use to work with it. In firefox download into your "Downloads" folder: http://download.astuntechnology.com/public/Workshop2011.zip Extract Workshop2011.zip by right-clicking it and choosing "open with archive manager", and save in the "Downloads" folder.
  • 13. Getting Started Then we need to download some sample mastermap data from the Ordnance Survey, as their license prevents us from distributing it. In firefox, go to: http://www.ordnancesurvey.co.uk/oswebsite/products/try- now/sample-data.html and download the OS MasterMap Topography Layer zip file This will be saved in your "Downloads" folder. Right-click it and choose "Open with Archive Manager" and extract it to the folder: /home/user/Downloads/Workshop2011/Data/OS MasterMap
  • 14. Getting Started Check the permissions on both the Workshop2011 folder, the _mapserverconfig folder, and the .map files. In File Manager, right-click the folder or file and choose "Properties". Choose the "Permissions" tab and ensure that it is set to read-only for the "Others" group. If presented with a dialogue asking you to make these changes to sub-folders and files, agree to it.
  • 15. Creating the database We are going to create a spatial database to hold the MasterMap and Vector-based Open Data. Open pgadmin3 from Geospatial (menu) -> Databases -> PG Admin III and expand the "Servers" list in the left-hand window. Double-click on "localhost" as that represents the local computer. Expand "localhost" and right-click on "Databases" to create a new database. This should be called mapbase The owner should be user The template should be template_postgis
  • 16. Creating the database Click OK to create the database
  • 17. Creating the database Next, we need to create some schemas in the database to hold the different types of data. Select the SQL window, choose the "open file" dialog and then browse to the file: /home/user/Downloads/Workshop2011/Software/create- schemas.sql Then click the "Execute Query" button to run the SQL
  • 19. Loading the Ordnance Survey Open Data In File Manager navigate to /home/user/Downloads/workshop2011/Software Make the script load-os-opendata.sh executable by right clicking the file in File Manager and in the Permissions tab checking "Allow this file to run as a program" and click OK Open a terminal window and type the following: cd /home/user/Downloads/Workshop2011/Software ./load-os-opendata.sh This might take a while... so we'll take a look at what data we've included: http://www.ordnancesurvey.co.uk/oswebsite/products/os- opendata.html
  • 20. Loading the Ordnance Survey Open Data
  • 21. Loading the Ordnance Survey Mastermap Data This requires the same process as before, so navigate to /home/user/Downloads/workshop2011/Software Make the script load-os-mastermap.sh executable by right clicking the file in File Manager and in the Permissions tab checking "Allow this file to run as a program" and click OK Open a terminal window and type the following: cd /home/user/Downloads/Workshop2011/Software ./load-os-mastermap.sh This will also take a while... so we'll take a look at the tools we're using at http://www.gdal.org/
  • 22. Raster Data Preparation As downloaded from the Ordnance Survey, the raster data needs some preparation to make it useable in mapserver (or any gis). Firstly, in File Manager, navigate to /home/user/Downloads/Workshop2011/Data and for each of the folders below, navigate into the named folder and move the georeferencing files, or .tfw files from ./data/georeferencing files/tfw to ./data, where the tifs are. Do this for each of the following folders: • 1 250 000 Scale Colour Raster • MiniScale • OS Street View • OS VectorMap District (Raster)
  • 23. Raster Data Preparation To make the multi-tile raster datasets, such as OS VectorMap District (Raster) and OS Street View work more efficiently in mapserver, we need to create a tileindex for each dataset. This is a shapefile of polygons representing the boundaries of each raster tile, with an attribute location recording the relative path to the tile.
  • 24. Raster Data Preparation In File Manager, navigate to /home/user/Downloads/Workshop2011, right-click data and choose "open terminal here". Type: gdaltindex "OS VectorMap District (Raster)/data/osvectormapdistrict.shp" "OS VectorMap District (Raster)/data/"*.tif Repeat for StreetView: gdaltindex "OS Street View/data/osstreetview.shp" "OS Street View/data/"*.tif Top tip: use the tab key to autocomplete directory and file names at the command line
  • 25. Testing your map file You can view your map file directly in a web browser using the following URL: http://localhost/cgi-bin/mapserv? map=/home/user/Downloads/Workshop2011/_MapserverConfig /OSOpendata.map&mode=map&layers=[layername] Substitute the name of a layer from your OSOpendata.map file (or the included map files)- remembering that it is case sensitive. Recall that some layers have a minimum and maximum scale at which they display. You can comment out these in the map file for testing purposes, using the # symbol.
  • 26. OH NO! It's all gone wrong! Errors will be shown in the browser window or in the log files in /var/www/temp.
  • 27. And finally... Once the map file is working correctly, it's time to see the results of all your hard work in a shiny OpenLayers map. Open a command prompt and type the following: sudo cp /home/user/Downloads/Workshop2011/Software/OpenLaye rs/opendatamap.htm /var/www/opendatamap.htm Finally, view the map in the browser at http://localhost/opendatamap.htm
  • 28. Extra Credit: Viewing the Data in Quantum GIS Now we have our vector data loaded into PostgreSQL, we can view it in any standards-compliant desktop GIS. Open Quantum GIS from the Geospatial (menu) -> Desktop GIS -> Quantum GIS Go to Layer (menu) -> Add PostGIS Layer, then click "new" and fill in the following: • Name (can be anything) • Host- Localhost • Database- mapbase • Username- user • Password - user • Port 5432 Tick the "save username" and "save password" boxes and test the connection
  • 29. Viewing the Vector Data in Quantum GIS
  • 30. Viewing the Vector Data in Quantum GIS Click on the "Connect" button to make a connection to the database. In the main window, expand the schemas and choose a table (or tables) to load, and click "Add"
  • 31. Viewing the WMS in Quantum GIS We can view our styled data as image data (not clickable) in Quantum GIS. Choose Layer (menu) -> Add WMS Layer. In the Layers tab, click "New" and give the server a name (like mapserver) and put in the following address as the URL: http://localhost/cgi-bin/mapserv? map=/home/user/Downloads/Workshop2011/_Mapserver Config/OSOpendata.map Leave the username and password blank, and click "OK".
  • 32. Viewing the WMS in Quantum GIS
  • 33. Viewing the WMS in Quantum GIS Click "Connect" to see the available layer groups from your map file. Expand these to see the available layers, and choose "Add" to add these to your map.
  • 34. We're Done! Yay!
  • 35. This would not have been possible without... OpenLayers
  • 36. 5/31/2011 Thank You! Matt Walker and Jo Cook