[gdal-dev] GDALPolygonize using float buffers

Jorge Arévalo jorge.arevalo at deimos-space.com
Wed May 18 06:44:06 EDT 2011


On Fri, May 13, 2011 at 4:00 PM, Frank Warmerdam <warmerdam at pobox.com> wrote:
> On 11-05-13 06:51 AM, Jorge Arévalo wrote:
>> Hello,
>> Is there any reason to limit the GDALPolygonize function to read data
>> in int32 buffers, instead of using 32b float or even 64b double ones?
>> As I stated in ticket #4005 (http://trac.osgeo.org/gdal/ticket/4005),
>> I want to code an alternative version using these kind of buffers. But
>> I don't know if I'm missing something.
> Jorge,
> There are no *compelling* reasons to limit polygonization to integer
> data, but once you get into floating point data lots of questions do
> arise about value comparisons will be done - will it be a "within
> epsilon" sort of test or are you looking for exact floating point matches?

I'm using the AlmostEqual2sComplement function from
to float comparison. Do you think it's a good approach?

> If a floating point option is available, I think there will still need to
> be a version of the algorithm operating on integer buffers to avoid
> problems representing some integer values in floating point and potentially
> more expensive comparisons.

Of course. I've created new algorithms for this (most of the parts
cloning the original ones). I'ts kinda duplicating code, but I don't
want to interfere with the original functions.

> That said, I'm ok with extending the function to support floating point
> bands.

Good :)

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

Best regards,

Jorge Arévalo
Internet & Mobilty Division, DEIMOS
jorge.arevalo at deimos-space.com

More information about the gdal-dev mailing list