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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Deschamps, Benjamin (EC)

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

 


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

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

Rutger
Hey Benjamin,

This is fixed with 2.1.3, see (at the bottom):
https://trac.osgeo.org/gdal/wiki/Release/2.1.3-News

A workaround is shown at:
http://osgeo-org.1560.x6.nabble.com/gdal-RasterizeOptions-output-type-tp5293573p5293575.html


Regards,
Rutger
Reply | Threaded
Open this post in threaded view
|

Re: gdal.Rasterize select output type different than Float64

Deschamps, Benjamin (EC)
Thank you, should have looked a bit further...

Benjamin

-----Original Message-----
From: gdal-dev [mailto:[hidden email]] On Behalf Of Rutger
Sent: January-31-17 6:01 AM
To: [hidden email]
Subject: Re: [gdal-dev] gdal.Rasterize select output type different than Float64

Hey Benjamin,

This is fixed with 2.1.3, see (at the bottom):
https://trac.osgeo.org/gdal/wiki/Release/2.1.3-News

A workaround is shown at:
http://osgeo-org.1560.x6.nabble.com/gdal-RasterizeOptions-output-type-tp5293573p5293575.html


Regards,
Rutger



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/gdal-dev-gdal-Rasterize-select-output-type-different-than-Float64-tp5305371p5305466.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev