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.
And you can use their maps in NavIt!
- 1 Getting a OSM map
- 2 Pre-processed OSM Navit Maps
- 3 Adding an OSM map to your mapset
- 4 See also
- 5 Problems with OSM and navit or navigation in general
- 6 Known countries by osm2navit
Getting a OSM map
If you want to learn more about the format used in conversion, for example to write a tool to extract a specific area, please have a look at Navit's binary map driver.
Pre-processed OSM maps in Navit's binary format are available from downloads.cloudmade.com. Files are updated once a week and are available for all countries of the world.
Processing yourself a small area
You will need to do the following :
Grab a map from OpenStreetMap :
Of course, adjust the bbox to the area you want to grab. Use a small area, or the grab may fail. To choose the area you can use The Information Freeway. After you get the coordinates of the area you want to download, put them in the wget command line. The syntax is: ?bbox=<bllon,bllat,trlon,trlat>, that is lon,lat order which is the inverse of what shown by Information Freeway (lat,lon).
Once you have the map.osm, parse it. There is a command for that in the navit/ folder after you have built the svn version.
cat map.osm | ./osm2navit mymap.bin
You can also process more than one map at once, but then you need the option --dedupe-ways for osm2navit to avoid duplication of way data if a way occurs multiple times.
cat map1.osm map2.osm map3.osm | navit/src/osm2navit --dedupe-ways mymap.bin
Getting a pre-processed planet.osm
This map should be updated every Saturday. Size is currently around 1.5GB
Primary Download Location
- Planet(~1.5GiB): wget http://maps.navit-project.org/planet.bin
- Europe: wget -O eu.bin http://maps.navit-project.org/api/map/?bbox=-12.963867187500007,33.59619140625,34.1455078125,72.09228515625
- Germany(~180MiB): wget -O germany.bin http://maps.navit-project.org/api/map/?bbox=5.185546875,46.845703125,15.46875,55.634765625
- France: wget -O france.bin http://maps.navit-project.org/api/map/?bbox=-5.44921875,42.01171875,8.437500000000002,51.6796875
- BeNeLux(~70MiB): wget -O benelux.bin http://maps.navit-project.org/api/map/?bbox=2.08740234375,48.8671875,7.778320312500001,54.51416015625
- Spain/Portugal: wget -O spainportugal.bin http://maps.navit-project.org/api/map/?bbox=-11.0302734375,34.87060546875,4.614257812500003,44.40673828125
Other Download Locations
- http://dev.openstreetmap.org/~deelkar/maps/ has maps for Europe, and several individual European countries
- http://downloads.cloudmade.com/ <-- weekly updated OSM XML files
Processing yourself the whole world, planet.osm
In case you want the whole planet.osm, and you can't or don't want to fetch it from the previous link, it is even possible to process planet.osm. It will take about 30 minutes, requires > 1GB of main memory and about 3 GB disk space for result and temp files:
bzcat planet.osm.bz2 | navit/src/osm2navit mymap.bin
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 excepts are a lot quicker to download and process.
Adding an OSM map to your mapset
Once you have your map from one of the 3 methods;
Now add a map source to your navit.xml:
<map type="binfile" enabled="yes" data="/path/to/mymap.bin" />
And navit will now be able to read your OSM maps.
(Note that since September 2007, NavIt is provided with a demo map of Munich.)
Search doesn't work in most countries
This is because osm2navit only knows about a few is_in tags. To fix this, look for a reliable is_in tag in the towns in your country. If there is none, contact us, we have some scripts which can help adding one in this case. Then add the tag (at most 3 per country) to this page. Unfortunately using the country border for detecting the membership of a town also isn't an option, because the boundaries are usually not closed or wrong.
OK, so the country you're searching is listed in the table below. Search probably will work. But be aware there are some quirks.
First, there is no "Search" button--searches will begin automatically as you fill in the gtk dialogue. Note there are minimum string length requirements. For instance the Town search only "activates" after 3 characters are typed, to prevent a huge number of results (which would take a lot of CPU time to find and display). If you really need to search for two character towns, you'll have to modify the navit source code.
Also, Navit's search process is hierarchical. Meaning you must search for and select a valid Country, then select a Town, then select a Street. Right now, zipcode, district, and street number (?) searches are unimplemented; only Country, Town, and Street actually work (as of svn r1175). Furthermore, there is no US State or County information; when searching for a US town, you may get hits from all over the US with planet.bin, and unfortunately, the states that each hit is in are not displayed. You basically have to use the Map button to examine them one-by-one, until you find the one you want (or, only travel to towns with unique names).
The dialogue sometimes moves the cursor between text boxes automatically. This can be pretty annoying.
Finally, there are a couple ways to crash (segfault) navit inside the search dialogue.
The developers are aware of these issues and plan to improve behaviour (this will happen faster if you send a patch!)
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. Currently all roads are considered as in a city, which leads to using shorter routes through a city.
Search for my town works, but I can't find my street
This is because OSM doesn't provide reliable information which town a street belongs to. We are currently estimating the area of a town (depending on the town type) and are using all streets which fall in this area. This works well most of the time, but of course is no 100% match. But the official OSM approach "A street belongs to its nearest town/village etc." doesn't provide always correct results also and is harder to code.
These are objects in OSM which have no representation in navit. This includes ways which have no tag and therefore are not visible in osmarender/mapnik maps. If you want to have tagged objects included in navit add an entry to the discussion what tags are used for this object and what item from Item_def.h should be used (suggest a new one together with how it should be rendered if no appropriate one exists).
Preferred is_in is the official english ISO 3166-1 country name. Local country name is also an option if it is unambiugous. Avoid abbreviations like ISO 3166-1 Alpha-2/-3 or the car country code, because they might be a ambiguous (for example FL might mean florida as well as Liechtenstein)
|ISO 3166-1 numeric country id)||is_in matches|
|724||Spain,Espana,Espana,Reino de Espana|
|840||USA (with svn r1175+)|