|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
having a problem with wrong extentHi there,
I've got some offset when rendering single images using Mapnik. I've imported an extract of OpenStreetMap-data [1] into my PostGIS using "osm2pgsql -c -l dortmund.osm", which means: stores as EPSG:4326 (+proj=latlong +ellps=WGS84 +datum=WGS84) instead of Spherical Mercator (SM). "SELECT srid FROM geometry_columns;" returns 4326 as expected. I've edited the template stylefile [2] to make it work on my system (correct parth, login to my PostGIS database). I've also removed the hardcoded extent, which belongs to SM, and set <Parameter name="estimate_extent">true</Parameter>. Here is my mapfile, a very simple one: [3] ------------------------------------------------------------------------ #!/usr/bin/python from mapnik import * # create map m = Map(500, 500) load_map(m, 'osm.xml') # set map-buffer to avoid labeling problems at edges m.buffer_size = 250 bbox = Envelope(7.50273893442,51.4803224939,7.50978821362,51.4849072287) m.zoom_to_box(bbox) im = Image(m.width, m.height) render(m, im) im.save('test.png', 'png') ------------------------------------------------------------------------ It creates this image: [4] But this image doesn't have the correct bbox / extent. This is what it should look like: [5] (this source is accurate). Could anyone please tell me, what I am doing wrong? I'm running Mapnik v0.6.1 with proj.4 v4.6.1 on Debian Testing. Same problem occures on latest Mapnik from SVN. Best regards, Tobias References: [1] 2.65 MB, 7zip: http://depot.tu-dortmund.de/get/7fqz7k [2] http://svn.openstreetmap.org/applications/rendering/mapnik/osm-template.xml [3] http://pastebin.com/m7e2de5b5 [4] http://depot.tu-dortmund.de/get/e2yx5r [5] http://tiny.cc/m01 _______________________________________________ Mapnik-users mailing list Mapnik-users@... https://lists.berlios.de/mailman/listinfo/mapnik-users |
|
|
Re: having a problem with wrong extentTobias,
What happens if you try adding this line to your python script (before setting the bbox)? m.aspect_fix_mode = aspect_fix_mode.GROW_CANVAS Dane On Sep 8, 2009, at 11:38 AM, Tobias Wendorff wrote:
_______________________________________________ Mapnik-users mailing list Mapnik-users@... https://lists.berlios.de/mailman/listinfo/mapnik-users |
| Free embeddable forum powered by Nabble | Forum Help |