Difference between revisions of "OpenStreetMap"

From Navit's Wiki
Jump to: navigation, search
(updated openstreetmap grabbing info)
Line 12: Line 12:
  
 
Of course, adjust the bbox to the area you want to grab. Use a small area, or the grab may fail.
 
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 [http://informationfreeway.org/ 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 script for that in the navit/src/script folder.
+
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.
  
  navit/src/script/osm2navit < map.osm > mymap.txt
+
  navit/src/osm2navit < map.osm > mymap.txt
 
 
WARNING ! Since API 0.4, osm2navit isn't up to date. You can use the temporary [http://navit.sourceforge.net/osm2navitv5 osm2navit2v5] until osm2navit is completely available for API 0.5. osm2navitv5 is used exactly like osm2navit.
 
  
 
Now add a map source to your navit.xml :
 
Now add a map source to your navit.xml :
  
  <map type="textfile" enabled="yes" data="/path/to/mymap.txt" />
+
  <map type="binfile" enabled="yes" data="/path/to/mymap.txt" />
  
 
And navit will now be able to read your OSM maps.
 
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.
 
Note that since September 2007, NavIt is provided with a demo map of München.

Revision as of 00:17, 5 November 2007

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!

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.

navit/src/osm2navit < map.osm > mymap.txt

Now add a map source to your navit.xml :

<map type="binfile" enabled="yes" data="/path/to/mymap.txt" />

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.