Geographic Information Systems Asked by Skinkie on December 10, 2020
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
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.
Answered by Skinkie on December 10, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP