4.5.24. OpenStreetMap
OpenStreetMap is a free editable map of the whole world. It is made by people like you. OpenStreetMap allows you to view, edit and use geographical data in a collaborative way from anywhere on Earth. Maps from OpenStreetMap can be used in Navit.
4.5.24.1. Quick Start
Go to Navit Planet Extractor (http://maps.navit-project.org/)
Zoom in and select the area that you are interested in. Use the ‘Map Controls’ on the right to switch between ‘Navigation’ and ‘Select’ modes. or use preselected areas:
Entire planet (curr. 10GB!)
Hit Get Map!
Move the downloaded map to the directory of your choice, and add it to the active the mapset (see Configuration) in navit.xml with a line similar to the following:
4.5.24.1.1. Add OSM map to your mapset
Move the downloaded map to the directory of your choice, and add it to the active mapset (see Configuration) in navit.xml with a line similar to the following:
4.5.24.2. Topographic Maps
Navit will display elevation/height lines but the required data is not included in most OSM derived maps.
Navit compatible maps with height lines can be created by feeding the output of Phyghtmap (http://wiki.openstreetmap.org/wiki/Phyghtmap, http://katze.tfiu.de/projects/phyghtmap/) to Navit’s maptool. Alternatively the SRTM data can be downloaded in osm.xml format http://geoweb.hft-stuttgart.de/SRTM/srtm_as_osm/, avoiding the Phygtmap step. The information can be either merged with OSM derived maps or used in a separate layer.
Many Garmin type maps such as http://www.wanderreitkarte.de/garmin_de.php also have the height lines information but routing will not work with them.
4.5.24.3. Processing OSM Maps Yourself
You can create your own Navit binfiles from OSM data very easily using maptool, the conversion program which installs alongside Navit. maptool can process both OpenStreetMap XML Data files (.osm files) and OpenStreetMap Protobuf Data files (.pbf files) Follow these steps to process your own maps.
4.5.24.3.1. Download your own OSM data
OSM data can be downloaded from a variety of sources. OpenStreetMap XML Data files are regular textfiles, easily editable in any text editor. OpenStreetMap Protobuf Data files are binary files, which take up less space (so are quicker to download and process) but are not editable.
OpenStreetMap XML Data
Geofabrik provides pre-processed OpenStreetMap XML Data files of almost all countries, and all continents. This method is probably the easiest way of downloading OpenStreetMap XML Data for an entire country or continent. Note that the OSM files are bzipped
planet.openstreetmap.org hosts the complete data set (the whole world). You can use Osmosis to cut it into smaller chunks.
OpenStreetMap ReadOnly (XAPI) The API allows to get the data of a specific bounding box, so that download managers can be used. For example:
wget -O map.osm "`http://xapi.openstreetmap.org/api/0.6/map?bbox=11.4,48.7,11.6,48.9 <http://xapi.openstreetmap.org/api/0.6/map?bbox=11.4,48.7,11.6,48.9>`__"
OpenStreetMap (visual) allows you to select a small rectangular area and download the selection as OpenStreetMap XML Data.
OpenStreetMap Protobuf Data
Geofabrik provides pre-processed OpenStreetMap Protobuf Data files of almost all countries, and all continents.
4.5.24.3.3. Processing the whole Planet
The OpenStreetMap wiki Planet.osm page lists mirrors where Planet.osm can be downloaded. There are also downloads of smaller areas such as the UK and parts of Europe. These smaller excerpts are a lot quicker to download and process.
In case you want the whole planet.osm (24GB in December 2012), it is even possible to process planet.osm. It will take about 7 hours , requires > 1GB of main memory and about 30 GB disk space for result and temp files - planet.bin is currently (as of December 2012) 9.6GB:
bzcat planet.osm.bz2 | maptool -6 my_Navit_map.bin
Please note -6 option (long name –64bit) used above. It should be used always if output bin file grows above 4GB, or generated file will not work at all. Using that option on smaller files slightly increases their size and makes them unreadable by some unzip versions.
4.5.24.4. Tips
To enable a map you have downloaded refer adding OSM map to navit.xml
If you don’t see any map data in Navit (assuming your map is properly specified in navit.xml) using the Internal GUI click anywhere on the screen to bring up the menu. Click on “Actions” and then “Town”. Type in the name of a town that should be within your map data. Select your town from the list that appears. This will bring up a sub-menu where you can click “View On Map”. Note that if you have a GPS receiver you can also just wait till you get a satellite lock.
To avoid changing navit.xml if you update your maps and the maps have different file names use the wildcard (*.bin) in your navit.xml file. For example:
4.5.24.5. See also
4.5.24.6. Problems with OSM
4.5.24.6.1. Search doesn’t work
Now maptool uses country boundary multipolygon relations for detecting town membership. Sometimes this isn’t an option, because the boundaries are not closed or wrong.
When there’s no multipolygon around the town, maptool will attempt to use is_in tags. It only knows about a few OSM is_in tags. Please help the osm community to fix the country boundary.
4.5.24.6.3. Search for my town works, but I can’t find my street
Maptool since April, 2013 uses polygones and multipolygon relations tagged with place=town/city/village etc to find place border.
Please note, there anyway should be a node tagged with the same name as surrounding [multi]polygon for town to be findable. If town boundary is found, it will be used as a limit for the street search.
Otherwise, city limit will be guessed by the place rank (city/town/village). This will often lead to streets not being found or found in neighboring places.
With the code improvements 1 of April 2013, maptool attempts to use admin_level=8 boundary relations in Germany to find town borders, as these are not tagged with place=* tags in Germany. If your country doesn’t use place=* tags on place boundaries, please report to trac which admin_level relations can be used to get town boundaries.
For some countries, we have established a correspondence of navit internal “State, county, district” terms to osm admin_level values. It makes it easier to find your town if there are many duplicate names without zip code. Report to trac if you have ideas how to extend this mapping to your country.
The following countries have a mapping to OSM admin_level for boundaries : Belgium, France, Germany, Poland, Russian federation, Switzerland, the Netherlands
4.5.24.6.4. Routes go through a city instead around of it
This is because OSM doesn’t provide any information whether a street is rural (can be driven with higher speeds) or not. In that case all roads are considered as in a city, which leads to using shorter routes through a city. The issue is in the OSM data, not Navit routing. You may want to fix the OSM data, in particular the speed limits (tag e.g. maxspeed=50) for inner-city roads, which are e.g. 50 km/h even when they are roads of higher order.