ubarsc / tuiview

TuiView is a lightweight raster GIS with powerful raster attribute table manipulation abilities
http://tuiview.org/
GNU General Public License v2.0
26 stars 13 forks source link

Enable approxstats if present or compute if none available #8

Closed bhjolly closed 4 years ago

bhjolly commented 4 years ago

We have a problem where TuiView will ignore stats in a file if they were only compute 'approximately', this PR fixes that.

This also changes the default behaviour of TuiView where no stats are present by only computing approximate statistics instead of full statistics to save time. We are assuming that no-one will be using the stats computed for proper analysis, only for computing a stretch. If this is a problem then I don't mind reverting the calls to ComputeStatistics().

gillins commented 4 years ago

Does this fix the issue with TuiView ignoring stats in Tiffs?

bhjolly commented 4 years ago

Not sure sorry, I don't seem to have an issue with the previous versions (at least not one that I can say for sure wasn't related to the rioscalcstats.py --approx issues). How would you replicate it?

gillins commented 4 years ago

So it works with GTiff and rioscalcstats.py --approx without recalculating stats?

bhjolly commented 4 years ago

Sorry, ran into some seg-faults trying to double-check this on the GTiff (calcstats not playing ball for large GTiffs where one band is all null).

Yes it appears to work for approx stats on GTiffs (and KEAs).