From Navit's Wiki
Revision as of 05:18, 27 June 2008 by Rphlx (talk | contribs) (Search process quirks)
Jump to: navigation, search

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!

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.

Processing yourself a small area

You will need to do the following :

Grab a map from OpenStreetMap :

wget -O map.osm,48.7,11.6,48.9

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/src folder after you have built the cvs 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

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 München.)

See also

Problems with OSM and navit or navigation in general

  • 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.

  • Search is totally b0rkz0r3d! Or, behaves very strangely vs other navigation software.

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--searchs will begin automatically as you fill in the gtk dialog. 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 dialog sometimes moves the cursor between textboxes automatically. This can be pretty annoying.

Finally, there are a couple ways to crash (segfault) navit inside the search dialog.

The developers are aware of these issues and plan to improve behavior (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.

  • There are strange purple objects on the navit map

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).

Known countries by osm2navit

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
40 Austria,Österreich,AT
124 Canada
276 Germany,Deutschland,Bundesrepublik Deutschland
528 Nederland,The Netherlands,Niederlande,NL
756 Schweiz
840 USA (with svn r1175+)