[Qgis-developer] worldfile update

Olivier Dalang olivier.dalang at gmail.com
Tue Apr 14 04:48:57 PDT 2015


Dear list,

I need to be able to update a worldfile and see the changes reflected in
QGIS.

Actually, it almost works. The worldfile is reread on each refresh, and my
changes are correctly taken into account.
But the extent of the raster is not refreshed, so the raster is cropped to
it's initial extent. When zoomed in, and doing some small adjustments, it's
not a problem, but when doing bigger changes on the worldfile, the raster
can even become completely invisible.


The only workaround I found was to remove the raster and re-add it
completely on each mapcanvas change. But it's an overkill and has a lot of
drawbacks (styling, CRS, etc...)

I tried those functions to refresh the extent :

myRasterLayer.triggerRepaint()
myRasterLayer.dataProvider().reload()
myRasterLayer.recalculateExtents.emit()
self.iface.mapCanvas().refresh()

But none of them seem to do the trick... Am I missing the correct method ?

Thanks !!

Olivier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150414/8f2529c8/attachment.html>


More information about the Qgis-developer mailing list