[gdal-dev] GDAL Polygonize with Uint32

Even Rouault even.rouault at spatialys.com
Mon Aug 5 09:39:11 PDT 2019


On lundi 5 août 2019 15:47:35 CEST Nikolaos Ves wrote:
> Hi list,
> 
> Currently, GDALPolygonize [0] reads the data to an int32 buffer before
> processing them.
> 
> If I invoke the function with UInt32 data, will the data be
> casted/truncated to Int32 and polygonized improperly or can I use it as it
> is?

Values between 2147483648 and 4294967295 will be read as 2147483647.

To avoid truncatino, you could use the GDALFPolygonize() interface that will 
work with Float32, but you'll then have roundings (several integer values will 
be read as the same Float32 value. As there are 23 bit for the mantissa, 
values under 2^23 == 8388608 will be exactly represented as Float32. Values 
above will suffer from this rounding effect)

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list