Vector Rendering in Monav SVN

Speyer Vector Rendering (Data by openstreetmap.org and its contributors, CC_by-SA)

Speyer Vector Rendering (Data by openstreetmap.org and its contributors, CC_by-SA)

Thanks to the work of James Hollingshead, MoNav SVN contains the first incarnation of a vector renderer which aims to be a high performance renderer which creates the required map tiles “on the fly”. The current SVN code is a bit awkward to compile and use, hence this posting. The info provided here is replicated by the OSM wiki. The following bash commands have been executed using Ubuntu Lucid 10.04.1 LTS. You will at least need Qt 4.5 dev packages, and probably some additional packages before MoNav will compile properly.

Compiling the Apps

First, let’s create a directory to host the stuff we need to compile and run MoNav

cd ~
mkdir MoNav-0.3
cd MoNav-0.3

Get the current code from the subversion repository:

svn checkout http://monav.googlecode.com/svn/trunk/ SVN

cd SVN

MoNav consists of a set of four programs. Except for the routing deamon, we will need all of them:

  • monavroutingdaemon
  • monavpreprocessor
  • monavpreprocessor-gui
  • monavclient

First compile the preprocessor. If you compile the preprocessor-gui first, you will subsequently need to remove any makefiles before compiling the preprocessor. Note that you need to pass DEFINES+=NOGUI on the command line:

qmake DEFINES+=NOGUI monavpreprocessor.pro && make

After that, a binary should appear in the bin directory. To compile the preprocessor-gui, use the following commands:

qmake monavpreprocessor-gui.pro && make

After that, a further binary should appear in the bin directory. Next, compile the client, the actual “end user” application. You will need qtmobility installed to compile the client. If you haven’t (e.g. on desktop computers), use DEFINES+=NOQTMOBILE to avoid errors:

qmake DEFINES+=NOQTMOBILE monavclient.pro && make

This should result in a third binary appearing in the bin directory:

ls ./bin/
monav monav-preprocessor monav-preprocessor-gui plugins_client plugins_preprocessor

In case nothing went wrong, the most challenging tasks are now accomplished.

Compiling the Maps

The next steps will create some map data. First create some directories to save the data necessary:

cd ..
mkdir osm monavmaps

Download some osm data. Choose a small file, as the map conversion requires both time and resources. Better try a small area first and convert another file later if you are sure you are pleased with the results:

cd osm
wget -c http://download.geofabrik.de/osm/europe/germany/saarland.osm.pbf

Next convert the downloaded data to MoNav map data. To ease the process, download the preconfigured file for bike routing first:

cd ..
cd monavmaps
wget https://www.christeck.de/wp-content/uploads/saarland.ini

It’s just an ordinary text file, editable in your editor of choice (but please remember that editor binaries always consist of two characters only). Alternatively open the file in the preprocessor GUI:

../SVN/bin/monav-preprocessor-gui

Press the button Load Settings... and select the downloaded file saarland.ini and adjust it to your likings. Save the settings file and close the preprocessor GUI.

Now the actual conversion is due. The preprocessor provides tons of command line switches. Let’s use a couple of them:

../SVN/bin/monav-preprocessor -di -dro -dre -da -dc -t=2 --name="saarland" -s="./saarland.ini" --verbose

This will take a little time. As soon the map data is converted, it is time to open it in MoNav.

Using the Maps

../SVN/bin/monav

In case MoNav complains a lot, delete or move its configuration file first:

mv ~/.config/MoNavClient.conf ~/.config/MoNavClient-old.conf

Choose the directory monavmaps containing the converted map data. Then click on the map view on the left hand side of the dialog and click the button Load. In case MoNav asks whether to uncompress the map data, confirm. MoNav then should prompt you with its viewport.

In case no map data is visible yet, click on the red circle button, choose address and select a location within your data set. This will center MoNav’s viewport around the desired area. In the example above, the inner city of Speyer is shown. Here’s the same area as displayed on the Nokia N900:

Speyer Vector Rendering N900 (Data by openstreetmap.org and its contributors, CC_by-SA)

Speyer Vector Rendering N900 (Data by openstreetmap.org and its contributors, CC_by-SA)

What’s next?

The rendering is far from being perfect, though the author did an excellent job. I’ll spend the rest of this evening to adjust the code and configuration files to improve the map appearance.