Hello all,
I am using mapnik to generate slippy maps, which are then used within my software. This works fine for the 'normal' projections, such as 900913.
But when rendering tiles in UTM, I face strange behaviors: some tiles seem to be shifted. I have already searched and found the description of similar problems for UTM rendering, but following the instructions (setting the extent paramter) did not really help.
These errors only occur when rendering tiles (using the generate_tiles.py script); generating a single image for the same region (generate_image.py) works fine...
Am I missing the point?

This is what I did:

  1. setup under windows: complete from the scratch, incl. PostgreSQL 9.1, PostGIS 1.5, Python 2.7, proj4
  2. Mapnik: installed version 2.0.1.RC0, mapnik python from http://svn.openstreetmap.org/applications/rendering/mapnik/
  3. Data loaded into DB using osm2pgsql with the -E 2157 option (UTM zone for Ireland)
  4. Changes in configuration:
    1. osm.xml, changed to (the string was provided by http://spatialreference.org/ref/epsg/2157/):
      <Map background-color="#b5d0d0" srs="+proj=tmerc +lat_0=53.5 +lon_0=-8 +k=0.99982 +x_0=600000 +y_0=750000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" minimum-version="2.0.0">
    2. datasource-settings.xml.inc: Projected Bounds from website ->
      <Parameter name="extent">418829.9650, 511786.6808, 786046.9273, 964701.5937</Parameter>
      
    3. settings.xml: changed the referenced osm2pgsql_projection:
      <!ENTITY osm2pgsql_projection "+proj=tmerc +lat_0=53.5 +lon_0=-8 +k=0.99982 +x_0=600000 +y_0=750000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs">
      
    4. generate_tiles.py:
      bbox = (-10.6000, 51.3300, -5.3300, 55.4000)
      

This little error troubles me now for some days; it is really frustrating, has anyone an idea of how to proceed? Is the patch mentioned in this message already part of mapnik_2.0.1.RC0?
A sample snapshot from the generated slippy map can be viewed at original post on mapnik forum

Kind regards, Dieter

asked 09 Aug '12, 08:11

19melo00's gravatar image

19melo00
26114
accept rate: 0%


generate_tiles.py uses spherical mercartor for calculating how big the tiles should be. And generate_image.py overrides the projection used in the style. You need to tweak these programs a bit to work with other projections.

permanent link

answered 09 Aug '12, 10:53

Gnonthgol's gravatar image

Gnonthgol ♦
13.6k15101198
accept rate: 16%

Gnonthgol, thanks for your answer. As I understand you, the problem might be due to the transformations between my map's srs and the class GoogleProjection used to calculate the tiles? I have checked the srs used within the map (and passed to the generate_tiles.py), that's excactly the one I intented to use (UTM 2157 with the settings above).

I have no idea how this 'bug' happens, but I can nail it down to the allignment of tiles. The error is more than one pixel, so simple rounding errors seem not to be the case. Can you give me some additional hints for the tweaking?

Thanks so far!

(10 Aug '12, 13:04) 19melo00
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×422
×389
×312
×8
×5

question asked: 09 Aug '12, 08:11

question was seen: 4,148 times

last updated: 10 Aug '12, 13:04

powered by OSQA