On 11-03-21 08:28 AM, Tom Jeffery wrote:
What is the proper way to extract all the unique values contained in a raster
Band object?  I had initially assumed that if a RasterAttributeTable object
existed, it would contain a "Value" column, but I have come across instances
where the only column in the table is a "Histogram" field containing the counts
of each pixel value, but not the value itself.

Currently, I check for the existence of the table, check to see if it has a
Value column, and if not, inspect each pixel value to get the unique set.  The
pixel scanning fallback method is quite slow, however, and when I view the same
rasters in ArcCatalog and bring up the "Table" view, it is able to instantly
display the typical Value / Count table.  Is there some trick I'm missing here
on how to get these values?

Tom,

I believe that ArcGIS is using the GetHistogram() method on the band which
can also find the histogram stored in other ways than a RasterAttributeTable.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmer...@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@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to