mapnik/mapnik — Issue #921: Non square pixel size issue with mapnik 2.0
Author: krysst
Created: 2011-10-19 15:50:28+00:00
State: open

Hi,

Posted first on Mapnik-devel.

--------------------------
THE PROBLEM

First, the normal rendering under mapnik 0.7.1 :
http://francetopo.fr/mapnik2/mapnik0.7.1.jpg

Then, the abnormal rendering under mapnik 2 :
http://francetopo.fr/mapnik2/mapnik2.jpg

The "explanation" :
http://francetopo.fr/mapnik2/mapnik2b.jpg

What you see on these pictures :
* soil ocupation (the green) is vector data from OpenStreetMap : all correct
* relief shadowing comes from Geotiffs : correct at the top of the picture, more and more fucked up as you go down... till there is nothing left to rasterize (the no shadow band), and then starts again with a correct line and so on.

-----------------------
MY SETTING

The raster dataset producing the relief shadowing is composed of four 2Gbytes GeoTiff, combined under a gdal VRT.

I use a french specific projection (Lambert 93 - EPSG:2154) :
srs="+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"

My vector & raster datas already are in EPSG:2154, so is there no re-projection at all during the rendering process.

I compiled mapnik 2 binaries with these libraries (debian SID) :
* proj4 4.7.0.1,
* gdal 1.7.3-6 (then 1.8.1),
* geos 3.2.2-3.
* libboost 1.46.1-7
* python 2.6

--------------------------------------------------
WHAT I TRIED UNSUCCESSFULLY

* mapnik 2 binaries : from the debian SID repository and compiled by myself (from 2.0.0 release src)
* compile mapnik 2 with GDAL 1.7.3-6 then GDAL 1.8.1
* mapnik driver : raster and gdal
* format : tiff + tfw, geotiff, png, gdal vrt...
* tiled and not tiled geotiff
* band and pixel interleave
* generate the rasters with OL+tilecache and with nik2img
* bicubic, lanczos scaling method
* cut the Geotiffs in smaller files (5000x5000 in place of 25000x25000)

-----------------------------
WHAT WORKED

Changing the pixel size of my raster dataset to a square one : original dataset had a pixel size of 21.000208352291551m x 23.158451421093591m, if I resample it to 21m x 21m, it seems to work perfectly.