[gdal-dev] gdal.Rasterize select output type different than Float64

Deschamps, Benjamin (AAFC/AAC) benjamin.deschamps at canada.ca
Mon Jan 30 12:00:05 PST 2017


Is it possible to specify the output type for gdal.Rasterize, similar to gdal.Warp and others? I don't see why the option would be available in the command line utility but not through the binding. It looks to be hardcoded in the source (https://github.com/OSGeo/gdal/blob/ba920209a2443b5a8492a23c16dd67fd53114c66/gdal/apps/gdal_rasterize_lib.cpp#L764).

Is it possible to fix or is there a workaround? For me the result is a much file than required (and associated slower I/O, increased memory usage).

Example usage:

myoptions = gdal.RasterizeOptions(attribute="MYATTRIBUTE")
gdal.Rasterize(dst_path, src_path, options=myoptions)

where the paths are direct file names to a Shapefile and a GeoTiff otput.

Thank you,

Benjamin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170130/8bd4613a/attachment.html>


More information about the gdal-dev mailing list