things to do with openstreetmap
Lluís Vicens
SIGTE - University of Girona
overview
- Available Data Sources and Download Options
- Data Processing and Edition
- Creating Maps on the web
- Database import
- Rendering and Styling
- Routing
-
Advanced Tools: Libraries, Widgets, Frameworks
objective
- Detection and summarize the different existing options, as well as potential applications using OSM data
-
Detection of
new services
and
applications
to be ofered for the benefit of the university community
1.1 Basic Available Data Sources & Download
a) Planet OSM
a) Planet OSM
A single file (20/25GB)
"All the nodes, ways and relations that make up your map"
Weekly updated
PBF or OSM XML
1.1 Basic Available Data Sources & Download
a) Planet OSM
b) HISTORY
b) History
- A single file ( > 39 Gb)
- "Full editing history of the OSM database"
- Monthly / Yearly updated
-
Latest: 08 - feb - 2013
1.1 Basic Available Data Sources & Download
a) Planet OSM
b) HISTORY
c) Diff. Files
c) Diff. files
"Contains changes in the OSM data over some period in time"
Minute / Hour / Day
Format = osmchange
File format used by osmosis, and osmconvert
Contains: creations / modifications / deletions
1.2 Other download options
a) By country / Region / Area
How to ...
Geofabrik
ThinkGeo
bbbike
metro
weogeo
Or you can directly download data from OSM.ORG
«DEMO»
1.2 Other download options
a) By country / Region / Area
b) By Small Region or by Typology
b) By Small Region... (I)
Tool: XAPI (Extended OSM API with search and query capabilities). Example of data download by BBOX:
Example of data download by BBOX and TAG/ELEMENT:
«DEMO TIME»
OSM XML & QGIS
b) By Small Region... (II)
Tool: Overpass.API (Optimized, search criteria by location, type of objects, tag properties, proximity... or a combination)
Bars and campings in Girona:
All about Girona:
http://overpass-api.de/api/interpreter?data=area[name=%22Girona%22];way(area);(._;%3E;%3C);out%20meta;
2.1 Data Edition
> How to participate?
Data Capture: GPS & Digitizing
> What to edit?
Add new lines / points / areas
Modify existing lines / points / areas
Correct errors and mistakes
Assign "characteristics" to elements
2.1 Data Edition
> TAGS
Each element has a TAG (or several TAGS) that give us its main characteristics
"Visit OSM Map Features page"
Wrong TAG -> Wrong search -> Wrong result
2.1 Data Edition
Map Generation = Validation + Upload
2.2 Data Edition Tools
More info:
http://wiki.openstreetmap.org/wiki/Editing
2.3 Top Data Editors: JOSM
2.3 Top Data Editors: JOSM
Offline editor
Simple and complex editions
Import GPS tracks, manual digitizing, use of WMS, Topology validation and upload
Extra functionalities
Documentation
2.3 Top Data Editors: Merkaartor
2.3 Top Data Editors: Merkaartor
Offline editor
Slightly different to JOSM
Some specific tools: transparency
Documentation
2.3 Top Data Editors: Potlatch2
2.3 Top Data Editors: Potlatch2
Online editor
Simple and fast editions
Basic tools for edition and labelling
Documentation
2.3 Top Data Editors: iD
2.3 Top Data Editors: iD
Online editor
Fast and friendly, intuitive GUI
Simple and fast editions
Tools for editing and labelling
Supports displaying and editing route relations and turns restrictions
Documentation
a) Tool: API Leaflet
Tool: API Leaflet
With just a few lines of code
It's Javascript! (executed on client side)
No requirements on server side
3. Creating maps on the web
a) Tool: API Leaflet
«DEMO TIME»
MYFIRSTMAP.HTML
4. Database import
Each tool generates a specific database
Different database -> Different purposes
Data organized by SCHEMA:
# number of tables, columns and relations
4. Database import
Tool: osm2pgsql
Grouped by Feature type
Tables:
# planet_osm_points
# planet_osm_line
# planet_osm_polygon
# planet_osm_road
Configuration: default.style
4. Database import
Tool: imposm
1 table for each type of entity
Tables:
# amenities
# places
# buildings
# ...
Tables with simplified spatial entities
Configuration: defaultmapping.py
Examples
$ osm2pgsql -U postgres -H sig7.udg.edu -W -P 5433 -d webinar_osm -E 25831 /home/lluis/Baixades/girona.osm
$ imposm --read /home/lluis/Baixades/girona.osm --overwrite
$ imposm --write -h sig7.udg.edu -d webinar_osm -p 5433 -U postgres --proj=EPSG:25831
osm2pgsql for windows: Yes
Imposm 3 (development) for windows: Yes
Osmosis for windows: Yes
Imposm 3 (development) for windows: Yes
Osmosis for windows: Yes
4. Database import
Osmosis is a "swiss knife" toolkit:
# generate dumps of a DDBB
# imports osm data into a DDBB
# produce change sets based on:
## history tables
## two planet dumps
# apply change sets to a DDBB
# extract data inside a bbox or polygon
# ...
5. Rendering
Rendering Tools:
# Mapnik
> http://www.mapnik.org
# TileMill
> https://www.mapbox.com/tilemill
5.1 Rendering with Mapnik
Allow the generation of raster layers (PNG, JPEG, PDF, ...) based on geospatial data
Supports shapefiles, PostGIS, TIFF, raster layers, OSM as well as other formats suported by the GDAL/OGR library
An XML (similar CSS) is used for the map design process
Mapnik is the rendering engine used by OSM or MapQuest
Mapnik is the rendering engine used by OSM or MapQuest
5.2 Rendering styles with TileMill
Is a desktop application developed for cartographic design, built upon Mapnik
Uses CartoCSS as a stylesheet language
Uses CartoCSS as a stylesheet language
Allow us to define styles and render images (over mapnik). Supports osm2pgsql and imposm schemas
OSMBright is a Tilemill project that offers a basis and templates for styling OSM data
6. Routing Tools
Tool: Osm2po
Multiplatform || requires Java 6+
Osm2po includes a GUI. Offers the possibility to generate SQL expressions compatible with pgRouting
6. Routing Tools
Tool: Osm2pgrouting
Requires PostgreSQL, PostGIS and pgRouting
Osm2pgrouting imports the data (osma format) directly to a PostgreSQL / PostGIS database while generates the graph structure
6. Routing Tools
Tool: Osrm (C++)
Osrm implements a high performance routing engine fro shortest paths in network analysis
It's very fast!
7. Other Libraries
Java, Perl, PHP, Python, R, Ruby
Imposm parser, osmread, J2memap, libosm, libOSM, libosmscout, libRoadNav, MapJumper, osm4routing, OSMLib, OsmSharp, ...
8. Widgets
BruTile, COSMCrtl, Halcyon, JXMapViewer, JMapViewer, JXMapKit, kogutowicz, libchamplain, Mapsforge, ...
9. Frameworks
# Osmium
# Osmosis
#OSMNavigation
# libOSM
# Cloudmade
More info: http://wiki.openstreetmap.org/wiki/Frameworks
A lot of thanks!
Lluís Vicens
SIGTE - University of Girona
Things to do with OSM
By sigte2014
Things to do with OSM
FOSS4G Nottingham
- 1,538