[Qgis-developer] How can I use QgsRasterDataProvider.write from Python in QGIS?

Radosław Pasiok rpasiok at gmail.com
Tue Feb 23 14:10:25 PST 2016


Sorry for cross-posting. I have asked that question before on StackExchange
[1] without much success. I would be very thankful if you can point me in
the right direction.

I would like to change a raster cell value from Python in QGIS using
QgsRasterDataProvider.write method. It takes the following arguments (from
QGIS API)
<http://qgis.org/api/classQgsRasterDataProvider.html#af15b6038b5c59276a4ef87598b919482>
:

virtual bool QgsRasterDataProvider::write   (
    void *      data,
    int     band,
    int     width,
    int     height,
    int     xOffset,
    int     yOffset
)

How can I construct the pointer (data) with a new cell value?

I am working on a plugin modifying single raster cell value [2] and the
QgsRasterDataProvider.write method would let me write a raster without
using GDAL.
Radek


[1]
http://gis.stackexchange.com/questions/181527/how-can-i-use-qgsrasterdataprovider-write-from-python-in-qgis
[2] https://github.com/erpas/serval
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160223/920834d4/attachment-0001.html>


More information about the Qgis-developer mailing list