1

I have some code written in Python using PyQGIS where I am trying to overlay a raster image gridded with coordinates on to a vector shapefile map with the same coordinates. However, when overlaying the raster image, the image is shifted up and also seems larger than it should be compared to the vector layer.

Currently I am using self.canvas.setExtent(layer.extent()) where layer = QgsRasterLayer(filename)

Any suggestions on how to correctly overlay the raster on the vector map?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.