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. #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. #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. #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
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. #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
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. #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
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
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. #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. #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. #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. #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
21. #foss4g13, Nottingham, Sept. 19th
#2 Data Edition Tools#2 Data Edition Tools
More info: http://wiki.openstreetmap.org/wiki/Editing#Choice_of_editors
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
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
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
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
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. #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. #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. #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. #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. #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. #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
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. #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!
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
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