Is there any way to read the width/height of the tiff rasterlayer in plugin? It seems that these properties aren’t available.
Thanks for any discussion and reply in advance.
Imported from GitHub discussion by @gitpydev on 2025-03-07T03:32:35Z
Is there any way to read the width/height of the tiff rasterlayer in plugin? It seems that these properties aren’t available.
Thanks for any discussion and reply in advance.
Imported from GitHub discussion by @gitpydev on 2025-03-07T03:32:35Z
Finally I found a way to get these properties.
Use the setCenterToLayer API provided by QgsQuickMapSettings, and set the map aligning with the rasterlayer which corresponds to the tiff image, then the API will set the mapsettings’ extent with the tiff’s width and height, finally one can get them from the extent.
Maybe it is tricky and not steady, but currently works for me.
Imported from GitHub comment by @gitpydev on 2025-03-14T12:09:05Z