OSM for developers – or, how I stopped worrying about layers, and love the database



OSM for developers – or, how I stopped worrying about layers, and love the database

2 1


slide-opengeodata-roma-2014

Slide per OpenGeoData Roma - 27 febbraio 2014

On Github cortesimone / slide-opengeodata-roma-2014

OSM for developers

or, how I stopped worrying about layers, and love the database

Simone Cortesi @simonecortesi

Maurizio Napolitano @napo

OpenStreetMap is a live ecosystem

Open Database License (ODbL)

It's difficult

Understanding the data

Existing Solutions

  • Linux, Virtual Machines
  • Osm2postgresql
  • OpenCageData
  • Geofabrik, Osm2Shp
  • Osm2pgsql, Osmosis

Solution

OSM “planet” files

  • Requesting large amounts of data from API can place undue load on the OSM server
  • API is really designed for adding and editing data, not retrieving
  • So OSM also makes its data available as downloadable “planet” files in OSM XML format, containing OSM data for the entire planet
  • Whole planet too large for most to use directly, so country or regional extracts available (eg. Geofabrik)

OSM planet is huge

  • The complete OSM Data
  • Latest Weekly Planet File: 33 GB
  • Latest Weekly Changesets: 782 MB

Rendering the map on your PC with Tilemill

Tilemill

  • Pavia
  • showing building age
  • colorcoding based on native OSM data
  • start_date=*
  • 2 hour job
  • tilemill is free and opensource software

web visualization

  • Openlayers
  • Leaflet.JS
  • Modestmaps
  • d3.js
  • mapstraction

Leaflet.JS

overpass-api

overpass-api

<query type="node">
	<has-kv k="amenity" v="drinking_water"/>
	<bbox-query {{bbox}}/><!--this is auto-completed with the
	current map view coordinates.-->
</query>

GIThub - integration

geojson.io

overpass-api

realtime styling

overpass turbo query

ISTAT

<osm-script output="json">
  <query type="area">
    <has-kv k="name" v="Italia">
  </has-kv></query>
  <query type="node">
    <has-kv k="place">    <has-kv k="population">    <has-kv k="place" v="city">
    <area-query>
  </area-query></has-kv></has-kv></has-kv></query>
  <print mode="body" order="quadtile">
</print></osm-script>
{{style:
node {
  color:blue;
  opacity:0.2;
  width:3;
  fill-color:blue;
  fill-opacity:0.4;
  symbol-shape: circle;
  symbol-size: eval('max(3,min(200,0.02*Math.sqrt(tag("population"))))');
}
}}

Wikimedia Italia

Editing the data

  • JOSM
    • Standalone editor, written in Java
    • Powerful and flexible
    • Communicates with API over HTTP
  • Potlatch
    • Online Flash Editor
    • Easy to use
  • iD
    • HTML5/JavaScript/d3.js, in early development

Help

  • help.openstreetmap.org
  • very active and helpfull mailinglst
  • Twitter @OpenstreetmapIT

products

products

product/service

Services

geocoding - routing - public transport - quality assurance

Geocoding

Search engine services

Search engine open source software

  • Nominatim php+postgresql
  • GISGraphy (LGPL) java+postgresql offers API for Android like Google
  • Photon (Apache License 2.0) java+postgresql+solr used in komoot

Komoot (top)

Komoot (bottom)

Routing

There are many offline, embedded and web-based routing services using OpenStreetMap data Please visit: http://wiki.openstreetmap.org/wiki/Routing

  • pg_routing: extension for postgis with osm data support GPL,C++
  • OSRM C++,BSD, research oriented
  • Graphhoper Java, Apache, Scales from big server to mobile device, works on Raspberry Pi
  • Spatialite VirtualNetwork C, GPL/LGPL/MPL, portable

... and other services in the cloud made available by Cloudmade, MapQuest, Skobbler...

Public Transport

OpenTripPlanner provides a range of passenger information and transportation network analysis features using our infrastructure for finding itineraries combining transit, pedestrian, bike, and car segments.network from osm, tpl from gtfs sources, lgpl, java

quality assurance

... again a lot of tools http://wiki.openstreetmap.org/wiki/Quality_Assurance

We suggest to look and collaborate with OSMOSE

OSMOSE

OpenStreetMap = users

Overview of OpenStreetMap Contributors

The most active users in Rome

Overview of OpenStreetMap Contributors

For Example: davio

Overview of OpenStreetMap Contributors

Davio's world

Your OSM Heat Map

Davio's activity 1/2

How did you contribute to OpenStreetMap?

Davio's activity 2/2

How did you contribute to OpenStreetMap?

Davio's home

OpenStreetMap - Davio home

Don't forget: OpenStreetMap is made by people

LIKE YOU

City of New York City and OSM

New York City and OpenStreetMap Collaborating Through Open Data

Milano

amat-mi.it

THANKYOU

Simone Cortesi @simonecortesi

Maurizio Napolitano @napo

Slides: CC-BY-SA