ubarsc / pyshepseg

Python implementation of image segmentation algorithm of Shepherd et al (2019) Operational Large-Scale Segmentation of Imagery Based on Iterative Elimination. Remote Sensing 11(6).
https://www.pyshepseg.org
MIT License
10 stars 4 forks source link

Guard the histogram against loss of precision due to GDAL's float32 h… #15

Closed neilflood closed 3 years ago

neilflood commented 3 years ago

…istogram storage. If required, re-calculate counts on-the-fly

gillins commented 3 years ago

OK so I checked and "Float" in RAT terminology is actually double - see ValuesIO call here: https://github.com/OSGeo/gdal/blob/master/gdal/gcore/gdal_rat.h#L260. Also HFA (https://github.com/OSGeo/gdal/blob/master/gdal/frmts/hfa/hfadataset.cpp#L823) and KEA (https://github.com/ubarsc/kealib/blob/master/src/libkea/KEAAttributeTableFile.cpp#L1107) do the actual writing as doubles.

Are you ok to close this?

neilflood commented 3 years ago

Yes, I will close this PR, and you should just go ahead with the other.