OpenStreetMap – how to get mobile Michal Páleník Freemap Slovakia Department of Cartography, Geoinformatics and Remote Sensing, Faculty of natural sciences, Comenius University in Bratislava
open data? what is OpenStreetMap Tiles, mbtiles, … Online service Vectors Current OSM mobile SW … please contribute
Licenses ?
FREE the DATA !!! Free DATA Open Data Free our data Open content Open access Free data Let data free
OpenStreetMap free wiki map of the world OpenStreetMap creates and provides free geographic data such as street maps to anyone who wants them. The project was started because most maps you think of as free actually have legal or technical restrictions on their use, holding back people from using them in creative, productive, or unexpected ways.
… not to forget
ODbL Open Database Licence LGPL of databases You are free: To Share: To copy, distribute and use the database. To Create: To produce works from the database. To Adapt: To modify, transform and build upon the database.
ODbL As long as you: Attribute: You must attribute any public use of the database, or works produced from the database, in the manner specified in the ODbL. For any use or redistribution of the database, or works produced from it, you must make clear to others the license of the database and keep intact any notices on the original database. Share-Alike: If you publicly use any adapted version of this database, or works produced from an adapted database, you must also offer that adapted database under the ODbL. Keep open: If you redistribute the database, or an adapted version of it, then you may use technological measures that restrict the work (such as DRM) as long as you also redistribute a version without such measures.
South Africa – football
freemap.sk
OMA.sk
OSM history 2004 – startup 2005 – users 2006 – mapnik rendering, Slovakia started 2007 – users, TIGER, AND, API v – 20 million ways, I joined 2010 – users 2011 – users 2012 – contributors, ODbL switch 2013 – contributors
Current volume As of Oct 2011 Mar 2012 April 2013 Number of users: # of nodes: (Y2K problem in March) # of ways: # of relations: planet.osm.bz2: 18 GB 20 GB 27 GB (bzip2ed)
Database structure
Tile 256 x 256 pixel, jpeg / png
Tile structure /${z}/${x}/${y}.png z – zoom 0 – 18 X goes from 0 (left edge is 180 °W) to 2^zoom − 1 (right edge is 180 °E) Y goes from 0 (top edge is °N) to 2^zoom − 1 (bottom edge is °S)
Openlayers Online site … init() …
OpenLayers JS var map, layer; function init(){ map = new OpenLayers.Map( 'map'); layer = new OpenLayers.Layer.OSM( "Simple OSM Map"); map.addLayer(layer); map.setCenter( new OpenLayers.LonLat( , ).transform( new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject() ), 12 ); }
Leaflet /leaflet.js html, body, #map { height: 100%; }
Leaflet var map = L.map('map').setView([51.505, ], 13); L.tileLayer(' { attribution: '© OpenStreetMap contributors' }).addTo(map); L.marker([51.5, ]).addTo(map).bindPopup('A pretty CSS3 popup. Easily customizable.').openPopup();
basic map normal html website some js calls to: openlayers CSS needed to set up arrows, plus/minus, … needed with and height of the map div probably override body, html height to 100% calling new map _after_ div exists
Online map for mobiles no hover/onmouseover event ;( mobile browser stealing double click click vs. click-and-move many tiles / pictures loading high browser cpu/ram load newer versions are aware of this
mbtiles tiles – many many small images in filesystem z/x/y.png bevare of strange little things called inode (df -i) mbtiles – sqlite database of tiles quite slow for serving but fast for transfer many frameworks to mimic tiles '/tms/mbtiles.php?db=cyklo&z={z}&x={x}&y={y}'
mbtiles for mobile several applications for mbtiles -> tiles run on mobile iOS SDK by mapbox … tiles are huge: Bratislava MB
TMI ??
Create your own tiles download OSM data from planet.osm.org or download.geofabrik.de or … using Osmosis: get a smaller portion feed into a program, get tiles Mapnik, Maperitive, Osmarender, Tilemill, … put tiles on a webserver, on another device create fancy good looking website
Mapnik Standard for high load server possibilities: minutely update from main OSM db mod_tile for ondemand rendering (apache module) very fast, postgis based minus pain to setup
Osmarender older package (pre mapnik) rendered on home desktops, tiles only stored on server huge disk requirements not developed any more (freemap.sk is somarender based, forked many years ago)
Maperitive free as beer MS Windows only application easy to setup and run (if you have MS Windows) produces tiles/mbtiles
Tilemill Ubuntu (and MS Windows & Mac) FOSS no Debian package (please, please, fix) desktop (and server) application Reads postgis, shp, Output tiles, mbtiles, Mapnik configuration, pdf easy to setup and run
Vectors for mobiles no standard comparable to tiles several possibilities huge performance problems with wrong programs
Maemo OSM2Go – editor Gosmore Marble
GpsMid J2ME application one midlet with data display, routing
Sygic Sygic has OSM based product please write them to make it public propretriary, but Slovak
Routing, navigation
Navit android + openmoko GPL v2 (also apple + …) full application offline rendering offline routing
Gosmore BSD for android, linux, … offline viewer and routing bzcat...osm.bz2 |./gosmore rebuild
Not only cars are transportworthy
OsmAnd GPL v3 Android full app offline display, offline navigation OsmAndMapCreator for your data
Other osmdroid – offline viewer (not Osmdroid) Rmaps …
Mapsforge LGPL v3. library for android drop in replacement for google maps api change from com.google.android.maps to org.mapsforge.android.maps. No "<uses-library..." reference no API key → extra setMapFile(File) method (no offline routing yet) Osmosis plugin to create binary data
Freemap plugin Freemap.sk Locus plugin 110 MB hiking of Slovakia ready on android playground (uses mapsforge)
iPhone ? anybody ?
Last but not least: EDIT !!! OpenStreetMap: free wiki map of the world
How to edit Collect data Upload data Create/Edit OSM data Label Data and add details Render and use maps
Programs Potlatch (WTFPL licenced) Josm, Merkaator OSM2go Mapzen POI collector, Osmaptuner, OsmAnd, Online tools … API (and libraries to use it)
Thank you Michal Páleník