Using OSM data The technical details.... Using OSM data Extracting data from planet.osm Setting up a PostGIS database Importing data into a PostGIS database.

Slides:



Advertisements
Similar presentations
Getting Started with Dreamweaver DREAMWEAVER MX. Getting Started with Dreamweaver Contents –What Can Dreamweaver MX Do? –Dreamweaver Learning and Support.
Advertisements

A Roadmap of Open Source components for GI Web Services and Clients A Paul R Cooper MAGIC.
Visualizing maps on the web. What is a Map? A map is a drawing that is the representation, on a certain scale, of a terrain.
Web Application Server Apache Tomcat Downloading and Deployment Guide.
OpenStreetMap 13th ICOM Andreas Oxenstierna Orienteerer since 1973 Professional mapper (Sweden, France, Croatia) Member of Swedish.
EAS781 Practical Geophysics: The Tools and How to Use Them ArcGis Introduction ArcView ArcInfo ArcGis ?
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
Website Development with PHP and MySQL Introduction.
OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson.
PHP Scripting Language. Introduction “PHP” is an acronym for “PHP: Hypertext Preprocessor.” It is an interpreted, server-side scripting language. Originally.
AgriDrupal - a “suite of solutions” for agricultural information management and dissemination, built on the Drupal CMS; - the community of practice around.
Dynamic Web site With PHP and MySQL. MySQL The combination of MySQL database and PHP scripting language is optimum for building dynamic websites. MySQL.
GreenSQL Yuli Stremovsky /MSN/Gtalk:
SubVersioN – the new Central Service at DESY by Marian Gawron.
WHAT IS PHP PHP is an HTML-embedded scripting language primarily used for dynamic Web applications.
Talend 5.4 Architecture Adam Pemble Talend Professional Services.
Administrative Stuff ECE 297. Administration Milestone 0: –Submit by Friday at 5 pm –Demo in lab this week –Write your name on the board when ready to.
SYST Web Technologies SYST Web Technologies Installing a Web Server (XAMPP)
Drupal Workshop Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology, Drupal technology, directories.
Linux Operations and Administration
OMap By: Haitham Khateeb Yamama Dagash Under Suppervision of: Benny Daon.
Open Source Web Mapping a non-developers perspective Andrew Parker Penn State University Masters in Geographical Information Systems Capstone Project Advisor:
Web Content Management Systems. Lecture Contents Web Content Management Systems Non-technical users manage content Workflow management system Different.
NSDI/NBII Clearinghouse Server Training Slide 1 NSDI/NBII Clearinghouse Server Training Yellowstone to Yukon Initiative 7. December University of.
Cascading Style Sheet. What is CSS? CSS stands for Cascading Style Sheets. CSS are a series of instruction that specify how markup elements should appear.
How Web Servers Work Browser ClientServer Web Server HTML File Image File HTML File Image File Internet URL.
Linux Operations and Administration
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Session 5: Working with MySQL iNET Academy Open Source Web Development.
EDUCATION YOU CAN TRUST ® Windows SharePoint Services Course Review Review provided by: DNS Computing Services, LLC
PHP. Why should we learn web programming? No need write socket programming. - You can forget TCP/IP & OSI layers. - Web server handles socket tasks for.
Karsten Vennemann, Seattle Free and Easy Web Mapping.
Internet Forms and Database Bob Kisel Amgraf, Inc.
Using PostGIS and MapServer in the Census Interaction Data Service Presentation to AGI Technical SIG 'Open-Source in GIS' British Antarctic Survey, Cambridge,
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
1 Apache. 2 Module - Apache ♦ Overview This module focuses on configuring and customizing Apache web server. Apache is a commonly used Hypertext Transfer.
Customer Relationship Management. Content CRM SugarCRM System Requirement Installation Process Configuration.
The FalconView Geodata Overlay
Tutorial: Using ArcGIS Server and ESRI ArcGIS API for Javascript Peter Sforza March 7, 2013.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
1 Library Assembly: Presenting the Confluence Wiki as an Alternative for Document Management.
Pushing the envelope… New and innovative ways to leverage Open Source Toolkits for the ERMA portal Aaron Racicot (Z-Pulley Inc) Dane Springmeyer (DBSGeo)
McGraw-Hill/Irwin The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Access 2002 Lab 3 Analyzing Tables and Creating.
Packaging for Voracity Solutions Control Panel David Turner.
The new European Toolkit EC-CHM Miruna Bădescu EEA contractor: Eau de Web.
Google Refine for Data Quality / Integrity. Context BioVeL Data Refinement Workflow Synonym Expansion / Occurrence Retrieval Data Selection Data Quality.
SCAPE Rainer Schmidt SCAPE Information Day May 5 th, 2014 Österreichische Nationalbibliothek The SCAPE Platform Overview.
NR 621: GIS on The Web Jim Graham Spring Dynamic Web Pages (server) Browser ClientServer Web Server HTML File Image File HTML File Image File Database.
Index pgRouting on PostgreSQL Introduction Installation Template Creation and Use Topological Structure Core Features Public Transit Implementation (Application.
PHP “Personal Home Page Hypertext Pre-processor” (a recursive acronym) Allows you to create dynamic web pages and link web pages to a database.
INFSO-RI Enabling Grids for E-sciencE ARDA Experiment Dashboard Ricardo Rocha (ARDA – CERN) on behalf of the Dashboard Team.
Maite Barroso - 10/05/01 - n° 1 WP4 PM9 Deliverable Presentation: Interim Installation System Configuration Management Prototype
Part 4: FCM and the UM University of Reading, December 2015.
 Packages:  Scrapy, Beautiful Soup  Scrapy  Website  
XAMPP.
GBIF Governing Board 20 Module 6B: New GBIF Tools II 2013 Portal and NPT Startup Daniel Amariles IT Leader, National Biodiversity Information System of.
GeoServer Prof. Wenwen Li School of Geographical Sciences and Urban Planning 5644 Coor Hall
Hydroinformatics Lecture 15: HydroServer and HydroServer Lite The CUAHSI HIS is Supported by NSF Grant# EAR CUAHSI HIS Sharing hydrologic data.
Freemap – OpenStreetMap for UK countryside users Nick Whitelegg Southampton Solent University
Installing and Configuring Moodle. Download Download latest Windows Install package from Moodle.orgMoodle.org.
Expertsfromindia for Joomla Development. Introduction Joomla is an open source and free content management system (CMS) for publishing content on the.
PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used, free, and efficient alternative.
ASP.NET 2.0 Mohammed Abdelhadi Developer.NET Evangelist Microsoft Corporation.
L.A.M.P. İlker Korkmaz & Kaya Oğuz CS 350. Why cover a lecture on LAMP? ● Job Opportunities – There are many hosting companies offering LAMP as a web.
Useful Tools for Testing
Web Based Spatial Decision Support System for Western Ghats
Kartotherian & Wikipedia Maps
Mapbox Studio Sarah and Haley.
SiteBuilder 2 Introduction.
Web Application Development Using PHP
Presentation transcript:

Using OSM data The technical details...

Using OSM data Extracting data from planet.osm Setting up a PostGIS database Importing data into a PostGIS database Rendering map data with Mapnik Using OpenLayers to create an OSM-based website

Extracting data from planet.osm Download a planet.osm extract from a server e.g. geofabrik.de  Planet extracts available from download.geofabrik.de/osm Use Osmosis to extract the data  Available from wiki.openstreetmap.org/index.php/Osmosis

Using Osmosis There is a good chance that we are only interested in certain OSM data For example, if we wish to create a map for walkers, we might only want to use countryside data Osmosis allows you to extract the data you want only

Osmosis Osmosis allows you to: Extract data by bounding box Extract all nodes or ways containing a particular key, or key/value pair Write OSM data to a MySQL or PostGIS database Read OSM data from a database and write to an OSM data file

Osmosis Example of Osmosis commands: osmosis --rx file=uk.osm -–bounding-box top=52 bottom=50 left=-2 right=-0 –-wx file=southern_england.osm This extracts a bounding box from uk.osm and saves it as southern_england.osm. osmosis –-rx file=uk.osm -–tf reject-ways –-tf accept-nodes place=* --wx file=ukplaces.osm This filters out all ways, and accepts those nodes with a ‘place’ tag, and writes to ukplaces.osm.

General principles of Osmosis Has a set of commands specified as command-line options e.g. --rx (read XML); --tf (tag filter) Commands typically filter the input stream So the following command : osmosis –-rx file=uk.osm -–tf reject-ways -–tf accept-nodes place=* --tf accept-nodes amenity=* --wx file=output.osm will only give nodes with both a place tag and an amenity tag If we want nodes with either a place tag or an amenity tag we must use named pipes and stream merging, see the Osmosis page for details

Setting up an OSM database You may wish to set up your own copy of the OSM database e.g. for rendering maps, or developing a web service of some kind Typically, a PostgreSQL / PostGIS database is used for this OSM data is imported into two tables planet_osm_point and planet_osm_line

Setting up PostgreSQL/PostGIS PostgreSQL and PostGIS normally available as packages for Linux distributions Installation fairly straightforward on current Ubuntu or Debian distributions Detailed installation instructions available at wiki.openstreetmap.org/index.php/Mapnik/PostGIS

Importing OSM data Having set up the PostGIS database we need to import OSM data into it A custom tool, osm2pgsql, is used for this This can be downloaded from OSM's subversion repository osm2pgsql allows us to control which map features are imported (by tag) See the osm2pgsql wiki page:

Mapnik To create our own maps we can use the Mapnik library ( C++ library with Python wrapper which allows easy creation of high-quality maps Source available from mapnik.org Binary packages available for Debian, Ubuntu, OS X, Windows Main dependency: Boost C++ libraries For installation details see: trac.mapnik.org/wiki/MapnikInstallation

Using Mapnik Mapnik is a library, not an application So to create maps with Mapnik, we have to write our own application (C++, Python) or use a pre-built Mapnik-based application Examples of pre-built applications:  mod_tile – Apache module to render tiles from PostGIS using Mapnik  generate_tiles.py – Python script to generate tiles at different zoom levels from a PostGIS database

Configuring Mapnik Mapnik styles are configurable with an XML file Basic units are styles, rules and layers Each broad class of feature (e.g. road, path, natural vegetation, landuse) is defined within a tag Within that, we define a series of s to match various tagging patterns We then set the colour, font, etc of each Finally we define s, each of which can contain several s

Example of Mapnik XML Style/Rule [natural] = 'wood' or [landuse] = 'wood' #aed1a0 [natural] = 'heath' #ffffc0

Example of Mapnik XML Layer paths (select way,highway from planet_osm_line where highway in ('path','footway','bridleway','cycleway') order by z_order) as roads postgis localhost 5432 gis Note how we link in a (paths) and specify the SQL to retrieve all objects in that layer

A word on the OSM tiling system OSM based sites normally use the “Google” tiling system Principle is: - At the highest zoom level, the entire world is shown on a 256x256 tile - Each subsequent zoom level zooms in by a factor of 2 - So, for example, zoom level 1 requires 4 tiles for the whole world (NW, NE, SW, SE quadrants), zoom level 2 requires 16, etc. See wiki.openstreetmap.org/wiki/ Slippy_map_tilenames

How to produce tiles generate_tiles.py script available from OSM Subversion repository ( This will pre-generate OSM map tiles from a postgis database Can configure bounding box and zoom levels Alternatively use mod_tile Apache module for live generation and caching of tiles from an OSM PostGIS database

Producing your own “slippy map” Having created your tiles, you need to use them in a web application Use the open-source OpenLayers JavaScript API ( An open source alternative to Google Maps, etc. See map.org.uk/course/osm/openlayers.xhtml to get started