OpenStreetMap

From Navit's Wiki
Revision as of 23:51, 25 January 2008 by SaPoX (talk | contribs)
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 http://www.openstreetmap.org/api/0.5/map?bbox=11.4,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