Things to do with OpenStreetMap

4,204 views

Published on

FOSS4G 2013, September. Nottingham

Published in: Education, Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,204
On SlideShare
0
From Embeds
0
Number of Embeds
250
Actions
Shares
0
Downloads
65
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Things to do with OpenStreetMap

  1. 1. #foss4g13, Nottingham, Sept. 19th THINGS TO DOTHINGS TO DO WITHWITH OPENSTREETMAPOPENSTREETMAP
  2. 2. #foss4g13, Nottingham, Sept. 19th OverviewOverview 1. Available Data Sources and Download options 2. Data Processing and Edition 3. Creating maps on the web 4. Database import 5. Rendering and Styling 6. Routing 7. Advanced Tools
  3. 3. #foss4g13, Nottingham, Sept. 19th ObjectiveObjective Detect and summarize the different existing options, and potential applications using OSM data. Detect of new services and applications to be offered to the university community
  4. 4. #foss4g13, Nottingham, Sept. 19th #1.1 Basic Available#1.1 Basic Available Data Sources &Data Sources & DownloadDownload a) Planet OSMa) Planet OSM b) History c) Diff. files
  5. 5. #foss4g13, Nottingham, Sept. 19th a) Planet OSMa) Planet OSM A single file 29 Gb “All the nodes, ways and relations that make up your map” Weekly updated PBF or OSM XML
  6. 6. #foss4g13, Nottingham, Sept. 19th a) Planet OSMa) Planet OSM
  7. 7. #foss4g13, Nottingham, Sept. 19th #1.1 Basic Available#1.1 Basic Available Data Sources &Data Sources & DownloadDownload a) Planet OSMa) Planet OSM b) Historyb) History c) Diff. files
  8. 8. #foss4g13, Nottingham, Sept. 19th b) Historyb) History A single file >39 Gb “Full editing history of the OSM Database” Monthly/Yearly updated Latest: 08-feb-2013
  9. 9. #foss4g13, Nottingham, Sept. 19th b) Historyb) History
  10. 10. #foss4g13, Nottingham, Sept. 19th #1.1 Basic Available#1.1 Basic Available Data Sources &Data Sources & DownloadDownload a) Planet OSMa) Planet OSM b) Historyb) History c) Diff. filesc) Diff. files
  11. 11. #foss4g13, Nottingham, Sept. 19th c) Diff. filesc) Diff. files “Contains changes in the OSM data over some period in time” Minute/Hour/Day Format=OsmChange File format used by osmosisosmosis and osmconvertosmconvert Contains: create/modify/delete
  12. 12. #foss4g13, Nottingham, Sept. 19th c) Diff. filesc) Diff. files
  13. 13. #foss4g13, Nottingham, Sept. 19th #1.2 Other download#1.2 Other download optionsoptions a) By Country / Region /a) By Country / Region / AreaArea b) By Small Region or by Typology
  14. 14. #foss4g13, Nottingham, Sept. 19th a) By Country / Region /a) By Country / Region / AreaArea
  15. 15. #foss4g13, Nottingham, Sept. 19th #1.2 Other download#1.2 Other download optionsoptions a) By Country / Region /a) By Country / Region / AreaArea b) By Small Region or byb) By Small Region or by TypologyTypology
  16. 16. #foss4g13, Nottingham, Sept. 19th Tool: XAPIXAPI (Extended OSM API with search and query capabilities) Example of data download by BBOXBBOX: http://open.mapquestapi.com/xapi/api/0.6/*[bbox=-77,38.8,-77.0,38.9] Example of data download by BBOXBBOX and TAG/TYPE/ELEMENTTAG/TYPE/ELEMENT: http://open.mapquestapi.com/xapi/api/0.6/node[amenity=university] [bbox=-1.2,52.9,-1.0,52.9] b) By small region...b) By small region...
  17. 17. #foss4g13, Nottingham, Sept. 19th Tool: Overpass.APIOverpass.API (Optimized, search criteria by location, type of objects, tag properties, proximity... or a combination) wget -O target.osm "http://overpass-api.de/api/interpreter? data=node[name="University of Nottingham"];out;" b) By small region...b) By small region... node[“name”=”Bonn”]; node (around:1000) [“name”=”Gielgen”]; out body;
  18. 18. #foss4g13, Nottingham, Sept. 19th #2 Data Edition#2 Data Edition > How to participate?> How to participate? Data capture: GPS & Digitizing > What to do? Edit!> What to do? Edit! Add new lines/points/areas Modify existing lines/points/areas Correct errors or mistakes Add “characteristics” to elements
  19. 19. #foss4g13, Nottingham, Sept. 19th #2 Data Edition#2 Data Edition > TAGS> TAGS Each element has a tag or several tags that give us its characteristics Take a look at “OSM Map Features” Wrong TAG → Wrong search → Wrong result
  20. 20. #foss4g13, Nottingham, Sept. 19th Map Generation = Validation + Upload
  21. 21. #foss4g13, Nottingham, Sept. 19th #2 Data Edition Tools#2 Data Edition Tools More info: http://wiki.openstreetmap.org/wiki/Editing#Choice_of_editors
  22. 22. #foss4g13, Nottingham, Sept. 19th #2 Top Data Editors:#2 Top Data Editors: JOSMJOSM
  23. 23. #foss4g13, Nottingham, Sept. 19th #2 Top Data Editors:#2 Top Data Editors: JOSMJOSM * Offline editor * Simple and complex editions * Import GPS Tracks, Manual digitizing, use of WMS, Topology validation and upload, ... * Extra functionalities * Documentation
  24. 24. #foss4g13, Nottingham, Sept. 19th #2 Top Data Editors:#2 Top Data Editors: MerkaartorMerkaartor
  25. 25. #foss4g13, Nottingham, Sept. 19th #2 Top Data Editors:#2 Top Data Editors: MerkaartorMerkaartor * Offline editor * Slightly different to JOSM * Some specific tools: transparency * Documentation
  26. 26. #foss4g13, Nottingham, Sept. 19th #2 Top Data Editors:#2 Top Data Editors: Potlatch 2Potlatch 2
  27. 27. #foss4g13, Nottingham, Sept. 19th #2 Top Data Editors:#2 Top Data Editors: Potlatch 2Potlatch 2 * On line editor * Simple and fast editions * Basic tools for edition and labeling * Documentation
  28. 28. #foss4g13, Nottingham, Sept. 19th #2 Top Data Editors: iD#2 Top Data Editors: iD
  29. 29. #foss4g13, Nottingham, Sept. 19th #2 Top Data Editors: iD#2 Top Data Editors: iD * On line editor * Fast and friendly, intuitive GUI * Simple and fast editions * Tools for editing and labeling * Supports displaying and editing route relations and turns restrictions * Documentation
  30. 30. #foss4g13, Nottingham, Sept. 19th #3 Creating maps on the#3 Creating maps on the WebWeb <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" /> <!--[if lte IE 8]> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.ie.css" /> <![endif]--> <script src="http://cdn.leafletjs.com/leaflet-0.5/leaflet.js"></script> <div id="map" style=”height: 180px; width:400px”></div> <script type="text/javascript"> var map = L.map('map'); var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; var osmAttrib='Map data © OpenStreetMap contributors'; var osm = new L.TileLayer(osmUrl, {minZoom: 8, maxZoom: 12, attribution: osmAttrib}); map.setView(new L.LatLng(51.3, 0.7),9); map.addLayer(osm); </script> API Leaflet Map: position & size OSM Layer Layer Properties Initial coordinates a) Tool: API Leaflet
  31. 31. #foss4g13, Nottingham, Sept. 19th #3 Creating maps on the#3 Creating maps on the WebWeb API Leaflet Map: position & size OSM Layer Layer Properties Initial coordinates Tool: API Leaflet With just few lines of code Javascript → Executed on client side No requirements on server side
  32. 32. #foss4g13, Nottingham, Sept. 19th #4 Database import#4 Database import Tool Use Schema Allow diff. files Contain predefined geometries Contain all the attributes osm2pgsql Rendering osm2pgsql Yes Yes No osmosis Mirroring apidb Yes No Yes osmosis Analysis pgsnapshot Yes Yes No imposm Rendering imposm No Yes No osm2pgsql Geocoding nominatim Yes Yes Yes * Each tool generates a specific DB * Different use * Organize the data: Schema → number of tables, columns and relations
  33. 33. #foss4g13, Nottingham, Sept. 19th #4 Database import#4 Database import Tools > osm2pgsql: group elements into a table by feature type Tables: planet_osm_polygon, planet_osm_line, planet_osm_point, planet_osm_roads Configuration: default.style # OsmType Tag DataType Flags node,way highway text linear node,way aerialway text linear node,way aeroway text polygon node,way amenity text polygon ...
  34. 34. #foss4g13, Nottingham, Sept. 19th #4 Database import#4 Database import Tools > Imposm: Generates one table for each type of entity: amenities, places, buildings, transport_points... Tables with simplified spatial entities Configuration: defaultmapping.py towers = Points( name = 'towers', mapping = {'man_made': ('tower', 'water_tower') } fields = ( ('height', Integer()), ) )
  35. 35. #foss4g13, Nottingham, Sept. 19th #5 Rendering#5 Rendering Tools > # Mapnik (mapnik.org) Allow the generation of raster layers based on geospatial data: PNG, JPEG, SVG and PDF
  36. 36. #foss4g13, Nottingham, Sept. 19th Tools > # Mapnik (mapnik.org) Supports shapefiles, PostGIS, TIFF, rasters, osm as well as other formats supported by the gdal/ogr library An XML (similar css) is used to the map design process #5.1 Rendering#5.1 Rendering
  37. 37. #foss4g13, Nottingham, Sept. 19th #5.2 Rendering styles#5.2 Rendering styles Tools > Tilemill, a software developed for cartographic design Tilemill: Allows to define styles and render images (over Mapnik). Supports osm2pgsql and Imposm schemas OsmBright, is a Tilemill project that offers a basis for representing OSM data
  38. 38. #foss4g13, Nottingham, Sept. 19th #5.2 Rendering styles#5.2 Rendering styles
  39. 39. #foss4g13, Nottingham, Sept. 19th #6 Routing#6 Routing Tools > Osm2po (Multiplatform, requires Java 6+) Osm2poOsm2po includes a GUI. Allows to generate SQL expressions compatible with pgRouting
  40. 40. #foss4g13, Nottingham, Sept. 19th
  41. 41. #foss4g13, Nottingham, Sept. 19th #6 Routing#6 Routing Tools > Osm2pgrouting (requires PostgreSQL, PostGIS and pgRouting) Osm2pgroutingOsm2pgrouting imports the data (osmaosma format) directly to a PostgreSQL / PostGIS database while generates the graph structure
  42. 42. #foss4g13, Nottingham, Sept. 19th #6 Routing#6 Routing Tools > Osrm (C++) OsrmOsrm implements a high performance routing engine for shortest paths in network analysis It's very fast!
  43. 43. #foss4g13, Nottingham, Sept. 19th #7 Libraries#7 Libraries Java, Perl, PHP, Python, R, Ruby Imposm parser, osmread, J2memap, libosm, libOSM, libosmscout, libRoadNav, MapJumper, osm4routing, OSMLib, OsmSharp, ...
  44. 44. #foss4g13, Nottingham, Sept. 19th BruTile, COSMCrtl, Halcyon, JXMapViewer, JMapViewer, JXMapKit, kogutowicz, libchamplain, Mapsforge, ... #7 Widgets#7 Widgets
  45. 45. #foss4g13, Nottingham, Sept. 19th #8 Frameworks#8 Frameworks * CloudMade * Osmium * Osmosis * OSMNavigation * libOSM More info: http://wiki.openstreetmap.org/wiki/Frameworks
  46. 46. #foss4g13, Nottingham, Sept. 19th #9 Conclusions#9 Conclusions With OSM we can do something more than download & edit data The OSM evolution has promoted the appearance of a constellation of tools, that brings added value beyond the data
  47. 47. #foss4g13, Nottingham, Sept. 19th #9 What's next?#9 What's next? Keep this document open and alive and updated
  48. 48. #foss4g13, Nottingham, Sept. 19th A lot of thanks!A lot of thanks! Lluís VicensLluís Vicens SIGTE – Universitat de GironaSIGTE – Universitat de Girona

×