[gdal-dev] GDAL Polygonize with Uint32

Darafei "Komяpa" Praliaskouski me at komzpa.net
Mon Aug 5 10:45:49 PDT 2019


There is a 6 year old request in PostGIS for distinguishing such values:
https://trac.osgeo.org/postgis/ticket/2353

On Mon, Aug 5, 2019 at 7:39 PM Even Rouault <even.rouault at spatialys.com>
wrote:

> 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
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev



-- 
Darafei Praliaskouski
Support me: http://patreon.com/komzpa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20190805/db2f5fb3/attachment.html>


More information about the gdal-dev mailing list