[ gpsdrive ] GPSdrive SVN, Mapnik and a Patch

Mark Wilkinson mark.wilkinson at 2pmtech.com
Thu May 29 03:14:43 AKDT 2008

Hello All,
     Please forgive me if this is not the correct place to post this, 
but after my cursory hunting, I can find no better place, plus it may be 
of help to others.

I should point out that all this has been down with SVN revision 1952 
and Mapnik version 0.5.1 on a Fedora 8 system

My build sequence was as follows :-
     download and compile mapnik 0.5.1
     setup postgis database and fill with osm planet data
     test mapnik rendering with osm rendering utilities
     checkout gpsdrive, compile and run.

After several days of false starts, I eventually traced all the problems 
I was having with the Mapnik rendering to the following problems :-

   1. the Mapnik input (plug-in) directory was hard coded
   2. only one font was catered for (supplied osm-template.xml used more
      fonts and cause problems)
   3. map rendering seemed to be somewhat south of the acutual position
   4. parameters for setting mapnik database settings not configurable
   5. the trackdir parameter is not used as the path to save track files
   6. minor compile warning about casting to/from int/double

Point 6 - put some int casts around mapnik_calcxy equations.

Point 5 - Not really a problem, more of a niggle - changed references 
from homedir to trackdir in the track reading & writing source code.

Point 3 - I had a problem with the maps produced by the mapnik code. the 
center was always some distance south of where it should have shown. I 
traced it to the Projection in the mapnik code that used '+proj=merc 
+datum=WGS84'. When I replaced this with the projection from the mapnik 
example code, the maps looked to be centered correctly.

Points 1,2,4 - I've added additional config parameters, all beginning 
'mapnik_', to allow the setting of

    * xml_file = path and filename of working mapnik xml file
    * xml_template = path and filename of mapnik xml template file
    * input_path = directory where mapnik plug-ins live
    * font_path = directory where mapnik fonts live
    * symbols_path = base directory for mapnik symbols
    * world_boundaries_path = base directory for mapnik world boundary
      shapes and db
    * dbname = name of postgis database (i.e. osm)
    * dbprefix = mapnik table prefix in database (i.e. planet_osm)
    * dbhost = database server host
    * dbport = database server port
    * dbuser = username to access database as
    * dbpass = password for above username

Note: dbhost,dbpass,dbuser can be set to '<clear>' to remove these lines 
from the generated osm.xml. dbport can be set to '-1' to have the same 

Additionally, rather than generating the mapnik xml file everytime 
gpsdrive is run, I've coded it to check the modification times on both 
the xml file (if it exists) and the xml template file and only generate 
the xml file if the template is newer.

Like I said at the top, this may not be the right place to post this 
patch, but it may be of benefit to others.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.gpsdrivers.org/pipermail/gpsdrive/attachments/20080529/31cb2d6b/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gpsdrive.patch
Type: text/x-patch
Size: 21146 bytes
Desc: not available
Url : http://lists.gpsdrivers.org/pipermail/gpsdrive/attachments/20080529/31cb2d6b/attachment-0001.bin 

More information about the GPSdrive mailing list