gdal 2.1 Rasterize

后端 未结 2 1723
臣服心动
臣服心动 2021-01-19 19:55

Is it possible to set the data type (Byte, Float32) when using gdal.Rasterize in gdal 2.1? Currently, I use gdal.Translate to convert to Byte, but this is inefficient.

2条回答
  •  情书的邮戳
    2021-01-19 20:45

    If you are in gdal 2.1.2, use gdal.RasterizeOptions() as if you were using it on the command line:

    opts_str = '-ot Byte'
    rast_opts = gdal.RasterizeOptions(options=opts_str)
    

提交回复
热议问题