On 30 Mar 2008, at 22:02, Rahkonen Jukka wrote: > Hi, > > I stopped my trials with rendering OSM maps to epsg:2393 projection > with Mapnik and generate_image.py utility. > Instead, I have been trying to learn first how to make maps in > default epsg:900913 projection. Unfortunately, however closely I > try to follow the instructions I am always getting maps which have > different east-west extents than I am giving as parameters in the > generate_image.py script. > > My environment: > - Python 2.5 > - Mapnik Windows binaries from: > http://download.berlios.de/mapnik/mapnik_win32_py25-0.5.0.zip) > - Generate_image.py downloaded from: > http://svn.openstreetmap.org/applications/rendering/mapnik/ > generate_image.py) > - OSM data downloaded from: > http://download.geofabrik.de/osm/europe/finland.osm.bz2 > - OSM data uploaded to PostGIS with osm2pgsql.exe (WIndows binaries) > Upload done with options: > osm2pgsql -d postgis -p osm_g -m finland.osm.bz2 > - osm.xml downloades from: > http://svn.openstreetmap.org/applications/rendering/mapnik/osm.xml > > In addition I have downloaded and installed symbol files, shoreline > data and World boundaries as advised in: > http://svn.openstreetmap.org/applications/rendering/mapnik/install.txt > > All I have changed are PostGIS database connection parameters and > paths to shapefiles. The system works with all the layers and I > can generate maps. The problem is that the resulting maps do not > have the same extents as I give in the generate_image.py file as > input parameters. > > For example, if I give these ll extents in generate_image.py: > ll = (24.0,60.0,25.0,61.0) > > the resulting map actually covers this area: > ll (23.4841,60.0,25.5117,61.0) > > > I have taken the latter coordinates from Information Freeway > coordinate display and verified them with GPS. > > I have repeated this test by different ll values dozens of times > and the result is always the same. Latitude values in the > resulting maps are the same I asked for, but not the longitude values. > > Is there anybody out there who could verify if there really is some > faulty coordinate transformation used for converting longitudes or > am I just doing something wrong? > > -Jukka Rahkonen-
You get slightly different extent because mapnik internally adjusts extent to fit map into provided image dimensions. In your case 1x1 degree square bounding box in geographical coordinate system translates into 'rectangular' shaped bounding box in Mercator with width/height ratio about 0.49318281553588506. It is slightly less then 0.5 and I suspect your Map object has width/ height=0.5 There are few ways to address this. For example, you can ensure that bounding box matches aspect ratio of the Map object (width, height). Or initialize Map object with dimensions necessary to fit your bounding box. HTH Cheers Artem > _______________________________________________ > Mapnik-users mailing list > [email protected] > https://lists.berlios.de/mailman/listinfo/mapnik-users > _______________________________________________ Mapnik-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/mapnik-users

