3

I am using OWSLib to retreive a single WMTS tile, and want to add a worldfile to that tile so I can present it in a more "simple tool". When opening both the calculated world file in Qgis the image was not positioned at the some point, which made me write everything down. Below can be used to solve the problem.

My input:

wmts.tilematrixsets['EPSG:28992'].tilematrix['00'].topleftcorner
(-285401.92, 903401.92)

wmts.tilematrixsets['EPSG:28992'].tilematrix['00'].scaledenominator
12288000.0

wmts.tilematrixsets['EPSG:28992'].tilematrix['00'].tileheight
256

wmts.tilematrixsets['EPSG:28992'].tilematrix['00'].tilewidth
256

wmts.tilematrixsets['EPSG:28992'].tilematrix['00'].matrixheight
1

wmts.tilematrixsets['EPSG:28992'].tilematrix['00'].matrixwidth
1

1 Answer 1

1

The solution:

A = scaledenominator * 0.00028
D = 0
B = 0
E = scaledenominator * -0.00028
C = topleftcorner[0] + ((column * tilewidth + 0.5) * A)
F = topleftcorner[1] + ((row * tileheight + 0.5) * E)

Within Qgis there is still a subpixel shift, interested to hear if the 0.5 pixel shift would be insufficient.

Your Answer

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

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