Difference between revisions of "OpenStreetMap"
(→Problems with OSM and navit or navigation in general)
|Line 91:||Line 91:|
| 756 || Schweiz
| 756 || Schweiz
Revision as of 04:37, 27 June 2008
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 Adding an OSM map to your mapset
- 3 See also
- 4 Problems with OSM and navit or navigation in general
- 5 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.
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/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.)
- 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.
- 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).
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|
|840||USA (with svn r1175+)|