24.12.2013

Navit-for-bike


Navit (under GPL v2) is a navigation-program for computers and smartphones. I made a few changes in this rule-file of the program, so it can avoid cobblestone-streets und prefer cycleways among streets. The map shows more details.

I changed rule-file of maptool for this. Changes in this file are marked with "KW:" from me. Maptool needs Openstreetmap-data und convert it for the map, shown in Navit. Its a tool from the Navit-Project. I use the development-package in Version 0.5.0. The ready map can be used in Navit 0.2.0 und 0.5.0.

How to change rules in Maptool for Keywords of streets a.s.o. The first line is copied from osm.c. The second line is the same in a seperate rule-textfile. The first character has to be the type n for node, w for way or ?, if its for both, ways and nodes. Then whitespaces and then the keyword of Openstreetmap-Key. Then whitspaces and keyword of navit.Nothing behind it!

"n barrier=lift_gate barrier_lift_gate\n"

n barrier=lift_gate barrier_lift_gate

How to change something. Want to show gate on the map, that has no own symbol on Navit-map as lift_gate, too:

n barrier=lift_gate barrier_lift_gate

n barrier=gate barrier_lift_gate

Now, Navit would show lift_gate and gate as lift_gate after processing maptool. barrier_lift_gate should be in your navit.xml in the layout-section.

In your own rule-file should be all other rule-lines, that you can find in osm.c in between static char *attrmap={...}.

You cannot create own Keywords for Navit, except with changing code. They are fix. You are free in use of Keywords of Openstreetmap.

Then, start maptool with maptool -r your-own-rule-file.txt -i source destination. Source is an Openstreetmap-file (*.osm). Start Navit with destination-file as map.

At least, I changed the config-file of Navit (navit.xml), so that it can route better for bike. And the map is better configured for bike. The tracks in forest and farmland are similiar to "Wanderreitkarte".



Here you can see the style similiar to „Wanderreitkarte“. The coloured ways shows you the quality of tracks



Here you can see, how Navit now avoid cobblestone-streets. The cobblestone-streets are marked with red stripes on both sides of the street.

Only in residential-streets, Navit avoids cobblestone. On other types of streets, they are marked only and not avoided .



Navit prefer now cycleways beside streets, marked with green stripes on both sides of street. Original Navit can only prefer seperated cycleways on own ways.

Here are the links to maptool-rules.txt for maptool of Navit and the special navit.xml, to configure Navit.

maptool-rules.txt for maptool

special navit.xml (Navit configurations-file) for Android

special navit.xml (Navit configurations-file) for Linux

Perhaps, you have another path to your map. So change it, please.

And since 7.11.2013 was here the package with compiled maptool include special osm.c-file for Linux (especially Ubuntu). Since 19.11.2013 there are more shops shown on the map. And Keyword sett (a special kind of cobblestone) is added for bike-routing. Since 24.12.2013 the rule-file is extern und there is no need to recompile maptool!

Take the rule-file after download and start maptool in the following way in a shell local:

cd /path/to/file

./maptool -r maptool-rules.txt -i /path/to/osm-map-data.osm /path/to/osm-map-data.bin

So osm-map-data.osm is the osm-data-file, loaded from internet. The result, produced by maptool, is then osm-map-data.bin. There is an option for maptool, to delete doubeled streets. You should not use this option, because the streets with cycelways only as an attribute are doubeled. Otherwise you cannot route on these cycleways for bike.

Navit-for-bike-forum. Here you can ask, if you have an idea or a question to Navigation for Bike or a more detailed map

General Navit-forum. Its online since summer 2013 and is very, very good!


*********************************************************************************************************

Now, I developed a tool to resolve the Multipolygons of Openstreetmaps. Navit is yet not able to handle Multipolygons. So, on the map a lot of areas (forests, riverbanks and s.o.) are not seen. Its written in Java.

The riverbank is a resolved Multipolygon of Openstreetmap-Data. Original-Navit shows there only a thin line.

Lizenz: GNU General Public License, GPL v2 (Software)

Here is now the Resolver for Openstreetmaps-Multipolygones. In the jar-file is the executable und source files included. You need the Java Virtual Machine (jvm) to run this program. Its tested on Ubuntu-Linux, it should work with all Linux-distributions.

To run this program, you should start it in local folder with:

java -jar Multipolygone.jar /path/to/file/Openstreetmap-file /path/to/destination/destination.osm

To run this program with more memory (p.e. for whole alps-region), you should start it in local folder with:

java -Xmx700m -jar Multipolygone.jar /path/to/file/Openstreetmap-file /path/to/destination/destination.osm

You can use compressed bzip2-file as openstreetmap-file, that ends with .bz2. Bzip2 should be installed on your computer, it comes not with Multipolygone.jar. On Linux, its usually installed. You can install it also on windows.

To get a ready bin-file for Navit-use, you should first process the openstreetmap-file with Multipolygone.jar and then with maptool from Navit or the special modified maptool from above for Bike-Routing.

Here the program to download:

download Multipolygon-Resolver

If you want use Multipolygone.jar on windows, install bzip2 for resolving bz2-compressed Openstreetmap-files. Its not tested, but perhaps the path to file should be in the way c:\\path\\to\\file\\file with doubled \. You should test it.