openstreetmap nick whitelegg some slides originally by andy robinson

34
OpenStreetMap OpenStreetMap Nick Whitelegg Nick Whitelegg Some slides originally by Andy Some slides originally by Andy Robinson Robinson

Upload: hugo-maxwell

Post on 22-Dec-2015

220 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

OpenStreetMapOpenStreetMap

Nick WhiteleggNick WhiteleggSome slides originally by Andy RobinsonSome slides originally by Andy Robinson

Page 2: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

What is OpenStreetMap?What is OpenStreetMap?

--Maps can be used by anyone without copyright Maps can be used by anyone without copyright

restrictionsrestrictions

Editable by anyoneEditable by anyoneAnyone can contribute new data to the map or Anyone can contribute new data to the map or

even edit the existing dataeven edit the existing dataA free and open data sourceA free and open data source

The raw map data is available for anyone to The raw map data is available for anyone to use in whatever way they likeuse in whatever way they like

Page 3: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

Why?Why?

Existing Data not Free & OpenExisting Data not Free & OpenLimits your rights to use the data as you wishLimits your rights to use the data as you wish

Data as a Static SnapshotData as a Static SnapshotCommercial data may be years oldCommercial data may be years old

Existing data not editableExisting data not editableIf you discover an error in an existing map, If you discover an error in an existing map,

you cannot instantly edit ityou cannot instantly edit it

Page 4: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

Where on the web?Where on the web?

Main siteMain site

http://www.openstreetmap.orghttp://www.openstreetmap.org

Wiki (the first point of call for all aspects of Wiki (the first point of call for all aspects of OSM-related information)…OSM-related information)…

http://wiki.openstreetmap.org/wiki/Main_Pagehttp://wiki.openstreetmap.org/wiki/Main_Page

Page 5: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

How does OSM work?How does OSM work?

Provide an Open PlatformProvide an Open PlatformOSM Users may freely input and extract dataOSM Users may freely input and extract data

Raw sources for OSM mapRaw sources for OSM mapGPS track logsGPS track logsExisting Free Data Sources (eg TIGER/LINE, Existing Free Data Sources (eg TIGER/LINE,

Ordnance Survey OpenData)Ordnance Survey OpenData)Historical Maps – Out of Copyright mappingHistorical Maps – Out of Copyright mappingBing / Yahoo! Aerial ImageryBing / Yahoo! Aerial Imagery

Users Create Map from Raw SourcesUsers Create Map from Raw SourcesVia Online and Offline Editing SoftwareVia Online and Offline Editing Software

Page 6: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

Building BlocksBuilding Blocks

Minimal Data Set for Maximum FlexibilityMinimal Data Set for Maximum FlexibilityNodesNodesWaysWaysTags –Annotations as key/value pairsTags –Annotations as key/value pairs

Full User History and Rollback abilityFull User History and Rollback ability

Page 7: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

Overview of in-field mapping Overview of in-field mapping procedureprocedure

Survey the ground using a GPSSurvey the ground using a GPSUpload the GPS track to the Upload the GPS track to the

OpenStreetMap siteOpenStreetMap siteMark sites of interest as waypointsMark sites of interest as waypointsUse an OSM editor to create the actual Use an OSM editor to create the actual

map datamap data

Page 8: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

Editing Map DataEditing Map Data

Page 9: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

EditingEditing

JOSMJOSMStandalone editorStandalone editorCross platform (written in Java 1.6)Cross platform (written in Java 1.6)Powerful and flexiblePowerful and flexible

PotlatchPotlatchOnline Flash editorOnline Flash editorEasy to useEasy to use

Page 10: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

JOSM – Loading GPS traceJOSM – Loading GPS trace

Page 11: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

JOSM – Creating OSM dataJOSM – Creating OSM data

Page 12: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

TaggingTagging

Page 13: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

OSM taggingOSM tagging

Properties of map objects in OSM are Properties of map objects in OSM are described by a series of described by a series of tagstags

Each tag has a Each tag has a keykey and and valuevalueThe The keykey is the general class of property, is the general class of property,

the the valuevalue is the actual value for that is the actual value for that propertyproperty

Page 14: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

Examples of tags for linear waysExamples of tags for linear ways

highway:highway: the class of road (motorway, the class of road (motorway, primary, secondary, etc)primary, secondary, etc)

maxspeed:maxspeed: maximum speed in km/h maximum speed in km/h refref : the road reference number : the road reference numberonewayoneway: is it a one way road? (true or : is it a one way road? (true or

false)false)

Page 15: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

Examples of tags for nodesExamples of tags for nodes

naturalnatural- If it’s a natural feature, indicates the type of natural If it’s a natural feature, indicates the type of natural

feature (hill summit, etc)feature (hill summit, etc)

man_mademan_made

- If it’s a man made feature, indicates the type of man - If it’s a man made feature, indicates the type of man made feature (water tower, mast, etc) made feature (water tower, mast, etc)

amenityamenity- If it’s an amenity (e.g. a pub, restaurant, recycling If it’s an amenity (e.g. a pub, restaurant, recycling

centre, etc), indicates the type of amenitycentre, etc), indicates the type of amenity

Page 16: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

OSM way tagging exampleOSM way tagging example

A main road could be described by the following A main road could be described by the following tags:tags:- highwayhighway = primary = primary

- Indicates it’s a “primary” class road- Indicates it’s a “primary” class road

- namename = High Street = High Street

- refref = A286 = A286- The road numberThe road number

- maxspeedmaxspeed = 50 = 50- Maximum speed in km/hMaximum speed in km/h

Page 17: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

OSM node tagging examplesOSM node tagging examples

Hill / Mountain:Hill / Mountain:- natural=peak; name=Snowdonnatural=peak; name=Snowdon

Pub:Pub:- amenity=pub; name=The Dolphinamenity=pub; name=The Dolphin

Place:Place:- place=village; name=Hursleyplace=village; name=Hursley

Communications mastCommunications mast::- man_made=mastman_made=mast

Page 18: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

Examples of tags for areasExamples of tags for areas

Areas are treated as ways (which just so Areas are treated as ways (which just so happen to be closed) in OSMhappen to be closed) in OSM

e.g.e.g. landuse landuse for man made landuse for man made landusee.g. landuse=forest; landuse=industrial; e.g. landuse=forest; landuse=industrial;

landuse=residentiallanduse=residentialor or naturalnatural for natural features for natural features

- e.g. natural=wood; natural=watere.g. natural=wood; natural=water

Page 19: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

Tagging referenceTagging reference

The OSM wiki has a full reference on commonly The OSM wiki has a full reference on commonly used tagsused tags See http://wiki.openstreetmap.org/wiki/Map_FeaturesSee http://wiki.openstreetmap.org/wiki/Map_Features

Use these tags if you want your data to be Use these tags if you want your data to be rendered by common renderersrendered by common renderers

However you are free to invent your own too!However you are free to invent your own too! For example you might wish to develop your own For example you might wish to develop your own

renderer which recognises your own tagsrenderer which recognises your own tags

Page 20: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

Potlatch Online EditorPotlatch Online Editor

Page 21: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

Rendering DataRendering Data

Page 22: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

Rendering dataRendering data

Default renderers (at Default renderers (at www.openstreetmap.org):www.openstreetmap.org):MapnikMapnikOsmarender / tiles@homeOsmarender / tiles@home

Custom mappingCustom mapping

Page 23: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

Custom renderingCustom rendering

MapnikMapnikHigh quality open source map drawing High quality open source map drawing

software librarysoftware libraryDevelopment possible in C++ or PythonDevelopment possible in C++ or PythonCross-platform: Linux, Windows, Mac OS XCross-platform: Linux, Windows, Mac OS XRenders various data sources, e.g PostGIS Renders various data sources, e.g PostGIS

database, shapefilesdatabase, shapefilesLayering multiple data sources possibleLayering multiple data sources possibleConfigurable via XML data fileConfigurable via XML data file

Page 24: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

MapnikMapnik

Page 25: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

How to set up your own tile serverHow to set up your own tile server

Download OpenStreetMap dataDownload OpenStreetMap dataPopulate a database (typically PostGIS)Populate a database (typically PostGIS)Install MapnikInstall MapnikConfigure rendering and data sources Configure rendering and data sources

with Mapnik XML filewith Mapnik XML file

Page 26: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

The OpenStreetMap APIThe OpenStreetMap API

API to allow developers to make use of API to allow developers to make use of OSM dataOSM data

REST compliant web serviceREST compliant web serviceAllows creation, retrieval and modification Allows creation, retrieval and modification

of map dataof map dataAvailable at Available at

http://www.openstreetmap.org/api/0.6/http://www.openstreetmap.org/api/0.6/

Page 27: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

OpenStreetMap API - ExamplesOpenStreetMap API - Examples

Retrieve map data in a given bounding Retrieve map data in a given bounding box (OSM XML format)box (OSM XML format)

– /map?bbox=-1.5,50.9,-1.4,51.0/map?bbox=-1.5,50.9,-1.4,51.0Retrieve a given way (here, way with ID Retrieve a given way (here, way with ID

223) 223) – /way/223 (GET request, retrieves OSM /way/223 (GET request, retrieves OSM

XML)XML)Modify a way (here, way with ID 223)Modify a way (here, way with ID 223)

– /way/223 (PUT request, send OSM XML)/way/223 (PUT request, send OSM XML)

Page 28: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

OpenStreetMap XML formatOpenStreetMap XML format

• <osm version="0.6"><osm version="0.6">

• <node lat="50.9" lon="-1.4" id="12345"><node lat="50.9" lon="-1.4" id="12345">

• <tag k="place" v="city"/><tag k="place" v="city"/>

• <tag k="name" v="Southampton"/><tag k="name" v="Southampton"/>

• </node></node>

• <way id="223"><way id="223">

• <nd id="1234" /><nd id="1234" />

• <nd id="1235" /><nd id="1235" />

• </way></way>

• ......

Page 29: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

OSM “planet” filesOSM “planet” files

The OSM server is intended to be for The OSM server is intended to be for contributing and editing datacontributing and editing data

Easily overloaded by excessive “read” accessEasily overloaded by excessive “read” access So OSM also makes its data available as So OSM also makes its data available as

downloadable “planet” files in OSM XML formatdownloadable “planet” files in OSM XML format Application developers can use extracts of these Application developers can use extracts of these

“planet” files in offline software“planet” files in offline software See See wiki.openstreetmap.org/index.php/Planet.osmwiki.openstreetmap.org/index.php/Planet.osm

Country extracts available (e.g. at GeoFabrik, Country extracts available (e.g. at GeoFabrik, Germany), as whole planet rather difficult to Germany), as whole planet rather difficult to managemanage

Page 30: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

Downloading OSM dataDownloading OSM data

OSMXAPIOSMXAPILive read-only serverLive read-only serverAccepts a range of queries based on bounding-box or Accepts a range of queries based on bounding-box or

tag typetag typeSee See http://wiki.openstreetmap.org/index.php/OSMXAPIhttp://wiki.openstreetmap.org/index.php/OSMXAPI

Examples:Examples:http://xapi.openstreetmap.org/api/0.6/node[amenity=pubhttp://xapi.openstreetmap.org/api/0.6/node[amenity=pub]]http://xapi.openstreetmap.org/api/0.6/node[bbox=-1,51,0,52]http://xapi.openstreetmap.org/api/0.6/node[bbox=-1,51,0,52]

Page 31: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

Extracting dataExtracting data

Even country extracts are fairly bigEven country extracts are fairly bigSo it is of value to perform further So it is of value to perform further

extraction of dataextraction of dataOsmosisOsmosis is a powerful and flexible tool is a powerful and flexible tool

which allows you to do thiswhich allows you to do thisCommand-line Java applicationCommand-line Java applicationSee See

http://wiki.openstreetmap.org/wiki/Osmosishttp://wiki.openstreetmap.org/wiki/Osmosis

Page 32: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

Mobile mappingMobile mapping

One or two options available for in-One or two options available for in-the-field mobile phone mappingthe-field mobile phone mapping

Mapzen POI collectorMapzen POI collector: points-of-: points-of-interest collector for iPhoneinterest collector for iPhone

VespucciVespucci: in-the-field Android editor: in-the-field Android editorMore here:More here:

http://wiki.openstreetmap.org/wiki/Editinghttp://wiki.openstreetmap.org/wiki/Editing

Page 33: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

Maps for Garmin GPSMaps for Garmin GPS

You can download OSM data to a Garmin GPSYou can download OSM data to a Garmin GPS Details at Details at

http://wiki.openstreetmap.org/wiki/OSM_Map_On_Garminhttp://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin

Two options:Two options: Pre-prepared maps for certain areas (typically Pre-prepared maps for certain areas (typically

updated weekly)updated weekly) See See

http://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin/Downloadhttp://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin/Download

Generate the map from OSM data yourself: use Generate the map from OSM data yourself: use mkgmapmkgmap or similar tools or similar tools

See See http://wiki.openstreetmap.org/wiki/Mkgmaphttp://wiki.openstreetmap.org/wiki/Mkgmap

Page 34: OpenStreetMap Nick Whitelegg Some slides originally by Andy Robinson

www.openstreetmap.orgwww.openstreetmap.org

wiki.openstreetmap.orgwiki.openstreetmap.org

Thanks for Listening

Nick Whitelegg

[email protected]