Thanks Jon,<br>I thought it might be an efficiency thing, but wasn't sure when we are using the postgis extensions anyway.  I didn't get that far through the osm2pgsql source code to spot it!<br><br>Regards<br><br>
Graham.<br><br><div class="gmail_quote">2010/1/2 Jon Burgess <span dir="ltr"><<a href="mailto:jburgess777@googlemail.com">jburgess777@googlemail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2010/1/2 Graham Jones <<a href="mailto:grahamjones139@googlemail.com">grahamjones139@googlemail.com</a>>:<br>
<div class="im">> I think I have found the problem - I was using planet_osm_nodes lat and lon<br>
> fields.  If I use the planet_osm_point way field, and extract the<br>
> coordinates using ST_X() and ST_Y() all of the numbers match up.<br>
><br>
> You can see the factor of 100 difference if you do:<br>
>       select id,lat,lon,astext(way) from planet_osm_nodes, planet_osm_point<br>
> where id=osm_id and id=27496146;<br>
><br>
> This gives:<br>
>    mapnik=# select id,lon,lat,astext(way) from planet_osm_nodes,<br>
> planet_osm_point where id=osm_id and id=27496146;<br>
>        id    |    lon    |    lat    |<br>
> astext<br>
><br>
> ----------+-----------+-----------+-------------------------------------------<br>
>     27496146 | -13446488 | 730126793 | POINT(-134464.883471724<br>
> 7301267.93936479)<br>
>    (1 row)<br>
><br>
>    mapnik=#<br>
><br>
> Is this a bug in osm2pgsql, or a 'feature'?   Does anything use the lat/lon<br>
> fields?<br>
<br>
</div>The factor of 100 is a feature and is setup at [1]. It allows<br>
osm2pgsql to store the position as a fixed point 32 it integer taking<br>
just 4 bytes, instead of the 8 bytes required for a double precision<br>
floating point value.<br>
<br>
osm2pgsql uses the lat/lon fields when looking up the node locations.<br>
<br>
<br>
1: <a href="http://trac.openstreetmap.org/browser/applications/utils/export/osm2pgsql/middle-pgsql.c#L27" target="_blank">http://trac.openstreetmap.org/browser/applications/utils/export/osm2pgsql/middle-pgsql.c#L27</a><br>

<br>
--<br>
<font color="#888888">    Jon<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Dr. Graham Jones<br>Hartlepool, UK<br>email: <a href="mailto:grahamjones139@gmail.com">grahamjones139@gmail.com</a><br>