browser-image
    Preparing search index...

    Function sampleRasterHistogram

    • Value counts of the picture bands of several rasters (the tiles of one picture), made to hold up on real imagery. Null when there is no value.

      Two things in satellite products spoil a plain rasterHistogram (its bins spread evenly from the smallest value to the largest):

      • A fill value that is not tagged as no data (-9999, -32768, the lowest float, 0 around a scene) takes the corners of the scene. It is often more than the few percent a stretch clips, so it becomes black (or white) and the scene itself lands at the other end, all white (or all black). The smallest or largest value of a band is taken as such a fill value, and left out, when it lies further from the rest of the values than the rest spreads (between its 1st and 99th percentile).
      • A few far outlying values (hot pixels, a fill value on overview edges blended with the scene) squeeze the values into a handful of bins. The bins are then taken again over the 1-99 % range widened by its own width on each side, with the values outside counted in the end bins.

      Imagery without either gets the same histogram as rasterHistogram over the rasters' range.

      Parameters

      • samples: readonly RasterSample[]
      • options: { bins?: number } = {}

      Returns RasterHistogram | null