[gdal-dev] Fwd: Problem with gdal.Rasterize utility : argument GDALDatasetShadow in wrapper_GDALRasterizeDestName

Fran├žois ALLAIN frallain at gmail.com
Fri Jul 15 01:45:39 PDT 2016


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160715/9a563f38/attachment.html>


More information about the gdal-dev mailing list