[OSM-talk] osm2pgsql enhancements

Jon Burgess jburgess777 at googlemail.com
Fri Mar 23 20:58:25 GMT 2007


On Fri, 2007-03-23 at 09:10 +0000, Artem Pavlenko wrote:
> On 23 Mar 2007, at 08:16, Martin Spott wrote:
> 
> > Martin Spott wrote:
> >
> >> Looks good so far,
> >>
> >> Table                   Experimental    Stable
> >> planet_osm_line         341886          341883
> >> planet_osm_point        102685          102685
> > [...]
> >
> >
> > ....  but the numerical representation differs. Stable:
> >
> > landcover=> select asText(wkb_geometry) from planet_osm_point where  
> > osm_id = 2;
> >                   astext
> > ------------------------------------------
> >  POINT(8.30237168388211 50.1360073958458)
> >
> >
> > Experimental:
> >
> > landcover2=> select asText(wkb_geometry) from planet_osm_point  
> > where osm_id = 2;
> >           astext
> > ---------------------------
> >  POINT(8.302372 50.136007)
> >
> 
> 
> 'Experimental' is using fixed point numbers to store coordinates,  
> which gives about 0.08m deviation.
> 

This is correct, the current code is using %f which only prints 6 digits
whereas the fixed point scaling should give around 7 decimal places of
accuracy or ~2.5cm max deviation if I remember correctly.

The old code used to print 15 digits (%.15g) which is way more than we
actually need. For simplicity I've made the new code output data using
%.15g too.


gis=> select astext(way) from planet_osm_point limit 4;
                  astext
-------------------------------------------
 POINT(-2.10528900954163 53.6041214145084)
 POINT(-2.15702775102232 53.5872830834469)
 POINT(-1.51815625 53.6135625)
 POINT(-2.17567845039748 53.4089094911056)


	Jon






More information about the talk mailing list