Class TiffRasterStatistics


  • public class TiffRasterStatistics
    extends java.lang.Object
    Collects and stores a set of simple statistics from the input raster.
    • Constructor Summary

      Constructors 
      Constructor Description
      TiffRasterStatistics​(TiffRasterData raster, float excludedValue)
      Constructs an instance of this class, tabulating results from the input raster data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getCountOfNulls()
      Get the count of the number of null samples in the collection.
      int getCountOfSamples()
      Get the count of the number of non-null and non-excluded samples in the collection.
      float getExcludedValue()
      Get the value that was set for exclusion, or a Float.NaN if not was set.
      float getMaxValue()
      Get the maximum value found in the source data
      float getMeanValue()
      Get the mean value for all sample values in the raster.
      float getMinValue()
      Get the minimum value found in the source data
      boolean isAnExcludedValueSet()
      Indicates if a sample value was set to be deliberately excluded from the statistics.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • nSample

        private final int nSample
      • nNull

        private final int nNull
      • minValue

        private final float minValue
      • maxValue

        private final float maxValue
      • meanValue

        private final float meanValue
      • excludedValue

        private final float excludedValue
    • Constructor Detail

      • TiffRasterStatistics

        TiffRasterStatistics​(TiffRasterData raster,
                             float excludedValue)
        Constructs an instance of this class, tabulating results from the input raster data.
        Parameters:
        raster - the input data
        excludedValue - an optional value to ignore; use Float.NaN if no value is to be ignored.
    • Method Detail

      • getCountOfSamples

        public int getCountOfSamples()
        Get the count of the number of non-null and non-excluded samples in the collection.
        Returns:
        the a positive number, potentially zero
      • getCountOfNulls

        public int getCountOfNulls()
        Get the count of the number of null samples in the collection.
        Returns:
        the a positive number, potentially zero
      • getMinValue

        public float getMinValue()
        Get the minimum value found in the source data
        Returns:
        the minimum value found in the source data
      • getMaxValue

        public float getMaxValue()
        Get the maximum value found in the source data
        Returns:
        the maximum value found in the source data
      • getMeanValue

        public float getMeanValue()
        Get the mean value for all sample values in the raster. Null-data values and excluded values are not considered.
        Returns:
        the mean value of the samples
      • isAnExcludedValueSet

        public boolean isAnExcludedValueSet()
        Indicates if a sample value was set to be deliberately excluded from the statistics.
        Returns:
        true if a value was set for exclusion; otherwise, false
      • getExcludedValue

        public float getExcludedValue()
        Get the value that was set for exclusion, or a Float.NaN if not was set.
        Returns:
        the excluded value (if any).