My bad... I finally got it working with your code :

import os
import sys
from osgeo import gdal, ogr, osr

geojson_filename = "my.geojson"
driver = ogr.GetDriverByName("GeoJSON")
vector_ds  = gdal.OpenEx( geojson_filename, gdal.OF_VECTOR )

geotiff_filename = "my.tif"
ds = gdal.Open(geotiff_filename, gdal.GA_Update)

ret = gdal.Rasterize(ds,
                    vector_ds,
                    bands = [4],
                    inverse = True,
                    burnValues = [0])

if ret != 1:
    print 'fail'
else:
    print 'success'

Cheers and thanks again

François
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to