[gdal-dev] Rasterize Inmem vector

Johan de Braak johan.de.braak at eleaf.com
Mon Jul 31 07:31:05 PDT 2017


Hi all,

How would I rasterize an in memory vector? I have tried this:
    
    assert isinstance(inmemds, ogr.DataSource), 'inmemds is not a ogr
DataSource' #assert not triggered
    
    rastoptions = gdal.RasterizeOptions(outputType=gdal.GDT_Byte,
burnValues=1, xRes=100, yRes=100)
    
    ds = gdal.Rasterize('/vsimem/tmp_{}'.format(uuid4().hex), inmemds,
options=rastoptions)


gives:

    TypeError: in method 'wrapper_GDALRasterizeDestName', argument 2 of type
'GDALDatasetShadow *'

The docstring of gdal.Rasterize says the following: 

    Arguments are :
      destNameOrDestDS --- Output dataset name or object
      srcDS --- a Dataset object or a filename

So srcDS can be a Dataset, right? As I missing something?

Regards,

Johan




--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Rasterize-Inmem-vector-tp5329885.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list