[ gpsdrive ] GPSdrive SVN, Mapnik and a Patch
Joerg Ostertag (gpsdrive Munich/Germany)
gpsdrive at ostertag.name
Thu Jun 5 14:42:37 AKDT 2008
On Donnerstag 29 Mai 2008, Hamish wrote:
> Mark Wilkinson:
> > > > I'm not sure how to measure this... it was enough to throw my
> > > > location in plymouth UK, several miles into the english
> > > > channel.. guess i'm gonna have to figure it out now :-)
> > >
> > > It seems to be approx 11' 19.61" south
>
> for 100-150m I would guess it was bad datum parameters, but for that much
> something else.
Maybe it is the wrong projection. We adapted the projection inside Gpsdrive
to what Mapnik used to take. But some weeks ago the standard projection on
the main OSM Site for the mapnik layer changed. So the osm-in.xml File for
Gpsdrive changed too.
svn log ./scripts/mapnik/osm-in.xml:
r1928 | tweety | 2008-05-08 23:30:38 +0200 (Thu, 08 May 2008) | 1 line
Update to the newest osm.xml from the mapnik directory (Autoconvert)
But the projection inside Gpsdrive was not adapted.
src/mapnik.cpp:
//mapnik::projection Proj("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0
+lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs
+over");
src/map_projection.c:
else if (strstr (filename, "mapnik/"))
proj = proj_map;
src/map_projection.c:
get_mapnik_calcxytopos(&lat, &lon, posx, posy, xoff, yoff, zoom,
MAP_X_2, MAP_Y_2);
get_mapnik_calcxy(posx, posy, lat, lon, xoff, yoff, zoom, MAP_X_2,
MAP_Y_2);
...
So I think we have two possibilities:
1) change back the projection in the osm.xml File.
2) write/adapt the
get_mapnik_calcxytopos
get_mapnik_calcxy
> for error up to half a degree often you might see Degreee Minutes being
> treated as DDD.MMMM, ie minutes misused as decimal degrees. if your patch
> helps, probably not that.
>
>
> for an explaination of +proj terms used below, see
> http://trac.osgeo.org/proj/wiki/GenParms
> and/or
> http://trac.osgeo.org/qgis/ticket/1035#comment:8
>
> ============================
> +++ src/mapnik.cpp
> @@ -38,7 +41,8 @@
> extern int borderlimit;
>
>
> -mapnik::projection Proj("+proj=merc +datum=WGS84");
> +//mapnik::projection Proj("+proj=merc +datum=WGS84");
> +mapnik::projection Proj("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0
> +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs
> +over");
>
> typedef struct {
> int WidthInt;
> ============================
>
>
> +datum=WGS84 should expand to specify +ellps=WGS84.
>
> In your corrected version, that is removed and the Earth's major and minor
> radii are exactly the same (+a,+b), so I would take a wild guess to say
> that it wants +ellps=sphere for the ellipsoid instead of +datum=WGS84 (thus
> +ellps=WGS84).
>
> That could possibly explain an error as big as 20km ....?
>
>
> these should all be redundant by the way, but don't really hurt:
> +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m
> +nadgrids=@null
>
>
> any links to what the projection parameters should be from Mapnik? (I
> assume all this is reprojected using the PROJ.4 library and somewhere a
> plain text explaination of the projection is given)
>
>
> +over is a new one for me, I don't know what that does.
> overlay? overlap? "end of terms"?
>
> Guenther Meyer wrote:
> > I wonder who changed this, the line from your patch for
> > setting the projection seems to be the right one; and the only one I
> > knew to be right...
>
> Without a ViewCVS web interface (nudge) it is hard to hit the "Annotate"
> button to see which rev for each line number, but "svn log" might help. I
> seem to recall something about the latest version of SVN having a "svn
> blame" command? (my debian/etch version is too old for that, so not sure
> exactly)
>
>
> Hamish
>
>
>
>
>
> _______________________________________________
> GPSdrive mailing list
> GPSdrive at lists.gpsdrivers.org
> http://lists.gpsdrivers.org/mailman/listinfo/gpsdrive
--
Jörg (Germany, Tettnang)
http://www.ostertag.name/
Tel.: +49 89 420950304
Skype: JoergOstertag
More information about the GPSdrive
mailing list