Hi,<br>I have a little Python application that populates a posgresql database using osm2pgsql, renders a map with mapnik and extracts information from the database to highlight points of interest.<br>I am having a bit of trouble with working out what units the coordinates of nodes are in in the postgresql database and hope it is obvious to someone:<br>
<br>I am using the -m option, which I think means it will use a spherical mercator projection ("+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").  I am using the same projection in my Python code.<br>
<br>What I find though is that when I use the mapnik.Projection() function to translate from lat/lon to spherical mercator y/x, my calculated values are a factor of 100 less than those in the postgresql database - If I just divide the postgresql database values by 100 and I plot them on my map they end up in the correct places.<br>
<br>It looks to me as though osm2pgsql must be storing the x/y values as integers in units of centimetres, but I thought that it was supposed to be in units of metres.<br><br>Is this the case, or have I got something wrong with my projections (If the answer is not obvious I will go and work out the maths myself to see what order of magnitude the xy values should be - I am not used to working in these coordinates).<br>
<br>Thanks,<br><br><br>Graham.<br clear="all"> <br>-- <br>Dr. Graham Jones<br>Hartlepool, UK<br>email: <a href="mailto:grahamjones139@gmail.com">grahamjones139@gmail.com</a><br>