2

I'm using tilestrata and mapnik server to host geotiff map. I'm getting very strange behaviour:

Doubling map

Basically, rendered tile shifts across map in strange fashion. The transformation from lat/long to XYZ is known and I implemented it correctly (works on other map).

One lead I can think of is the fact, that the map uses different units for pixel width and height (other maps I was using had square pixels).

EDIT: Converted map to have "square" pixels using gdalwarp and gdaltranslate - bug is still on!

Any ideas what can cause such a strange behaviour?

Can I somehow set different aspect ratio of pixel in proj4 srs info?

Here is the gdalinfo from the file:

Driver: GTiff/GeoTIFF
Files: GIG_halda_jadwiga_orto_2cm.tif
Size is 40549, 35453
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (19.165103727574930,50.334287477469992)
Pixel Size = (0.000000280890000,-0.000000179799000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  19.1651037,  50.3342875) ( 19d 9'54.37"E, 50d20' 3.43"N)
Lower Left  (  19.1651037,  50.3279131) ( 19d 9'54.37"E, 50d19'40.49"N)
Upper Right (  19.1764935,  50.3342875) ( 19d10'35.38"E, 50d20' 3.43"N)
Lower Right (  19.1764935,  50.3279131) ( 19d10'35.38"E, 50d19'40.49"N)
Center      (  19.1707986,  50.3311003) ( 19d10'14.88"E, 50d19'51.96"N)
Band 1 Block=256x256 Type=Byte, ColorInterp=Red
  Overviews: 20275x17727, 10138x8864, 5069x4432, 2535x2216, 1268x1108, 634x554, 317x277, 159x139
  Mask Flags: PER_DATASET ALPHA 
  Overviews of mask band: 20275x17727, 10138x8864, 5069x4432, 2535x2216, 1268x1108, 634x554, 317x277, 159x139
Band 2 Block=256x256 Type=Byte, ColorInterp=Green
  Overviews: 20275x17727, 10138x8864, 5069x4432, 2535x2216, 1268x1108, 634x554, 317x277, 159x139
  Mask Flags: PER_DATASET ALPHA 
  Overviews of mask band: 20275x17727, 10138x8864, 5069x4432, 2535x2216, 1268x1108, 634x554, 317x277, 159x139
Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
  Overviews: 20275x17727, 10138x8864, 5069x4432, 2535x2216, 1268x1108, 634x554, 317x277, 159x139
  Mask Flags: PER_DATASET ALPHA 
  Overviews of mask band: 20275x17727, 10138x8864, 5069x4432, 2535x2216, 1268x1108, 634x554, 317x277, 159x139
Band 4 Block=256x256 Type=Byte, ColorInterp=Alpha
  Overviews: 20275x17727, 10138x8864, 5069x4432, 2535x2216, 1268x1108, 634x554, 317x277, 159x139

1 Answer 1

0

Seems I have reached the root of the problem: It seems that mapnik does some sort of operation on map extent after setting it:

Consider "bbox" coordinates in latlong units for troublesome tiles:

data = [minx, miny, maxx, maxy]

I'm setting my map extent using it:

map.extent = data

As a result of: console.log(map.extent) I get array that is different than data.

Why and what mapnik is doing in map.extentsetter is yet to be decided.

EDIT: Solved by adding option:

map.aspect_fix_mode = mapnik.Map.ASPECT_RESPECT;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.