[Gdal-dev] Limitation in gdal_rasterize

Luke Roth roth.luke at gmail.com
Fri Jun 8 12:08:24 EDT 2007


I've noticed a limitation in gdal_rasterize: it seems to be saving all
values as 8-bit data regardless of the data type of the target image.
For example, I have a shapefile for which the value of the feature
being rasterized is 710, and I use gdal_rasterize and pass it an
unsigned 16-bit image to rasterize to, and the value saved to the
image is 195.  I've browsed through the gdalrasterize.cpp code and it
seems to have special-case code to handle both GDT_Byte and
GDT_Float32 data, but no others.  However, I don't feel I understand
the code well enough yet to know if this is intentional or if it
should be fixed.  The code in issue is from gdalrasterize.cpp, lines
319-387 (gdal version 1.4.1), where eType is limited to GDT_Float32
for all non - GDT_Byte source image types.  If this should be changed,
let me know and I can submit a patch.

I apologize if I should be submitting this to the tracker / wiki page,
I haven't figured out how to use it yet - are there any guidelines,
etc. that I haven't seen?

Thanks,

Luke Roth
www.gdacorp.com



More information about the Gdal-dev mailing list