[Gdal-dev] boolean data type?

Frank Warmerdam warmerdam at pobox.com
Wed Dec 11 09:52:43 EST 2002


Vincent Schut wrote:
> Does anybody know of a boolean data type supported by GDAL? I am making
> masks for several gigabytes of data (timeseries) and it would save me
> quite some diskspace if I could save them as bits instead of bytes...
> I think tiff theoretically could be b/w instead of grayscale, but I
> can't find a GDT_bool like datatype...
> 
> I could of course just write the raw boolean data to disk as it will
> always be coupled with some georeferenced other data file, but it would
> be nicer to have it in some GDAL supported format.

Vincent,

There is no 1bit data type even though there is a decent case to be made for
it's support.   Partly I avoid it because having a less-than-a-byte data
type will complicate alot of code.

I would suggest you save treat your masks as 8bit data, and save in a
compressed format, such as COMPRESS=DEFLATE with GeoTIFF.  This should
pack the data down to the minimum required, hopefully less than uncompressed
1bit data.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list