[OSM-talk] labs.mc.com osm update

Jon Burgess jburgess777 at googlemail.com
Thu May 10 18:51:40 BST 2007


On Thu, 2007-05-10 at 12:01 +0100, Artem Pavlenko wrote:
> 
> On 10 May 2007, at 11:31, Martin Spott wrote:
> 
> > Hi Jon,
> > 
> > 
> > Jon Burgess wrote:
> > 
> > 
> > > The latest osm2pgsql outputs data in mercator format instead of
> > > latlong
> > 
> > 
> > I don't grasp the benefit of this change for the current use - would
> > you explain it to me (and probably to others as well) ?
> 
> Hi Martin,
> This was my idea :) . Well, it speeds up tile rendering a bit. Jon
> might have some numbers.
> Perhaps, projecting coordinates into Mercator should be  (is?)
> optional. 
> 
It was for the benefit of mapnik. The default map projection in osm.xml
is mercator so mapnik was previously reprojecting all PostGIS data
during the rendering. 

Doing this reprojection once during osm2pgsql instead of every time a
tile is rendered at each zoom level made sense. I don't have hard
numbers, but some quick tests I did suggested that this sped up the
mapnik rendering by around 5 - 10%.

The reprojection could be removed by commenting out the following line:

osm2pgsql.c:164
	reproject(&node_lat, &node_lon);

And change middle-ram.c:33
	#define SCALE 100
to
	#define SCALE 10000000

It could be made optional fairly easily but I've not got around to
adding any command line options into the code yet.

	Jon

> 
> 
> 
> 
> _______________________________________________
> talk mailing list
> talk at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk





More information about the talk mailing list