sul-dlss / earthworks

Geospatial discovery application for Stanford University Libraries.
https://earthworks.stanford.edu
Other
21 stars 3 forks source link

Preview band/color information on record show page for raster data #1172

Open thatbudakguy opened 4 weeks ago

thatbudakguy commented 4 weeks ago

Note: this ticket applies only to Raster datasets (georeferenced maps, satellite imagery, etc.). For the version specific to Vector data, see #1162.

This ticket is for exploring ways to display information about the bands and color information present in raster images as a preview so the user can get a general idea of the data. This is different from inspection ("what info is at the pixel that I clicked?") and is instead intended to represent a general survey or broad understanding of all the data or a preselected sample, to help the user make an informed decision about downloading. It's more accessible and can be displayed without asking the user to pick a point using a mouse.

Rasters usually contain information available via GeoServer or other queries about what pixels and bands make up the image, as well as its coordinate system and other info. A gdlinfo query on a satellite image in .jp2 format contains, for example:

Band 1 Block=1024x1024 Type=Byte, ColorInterp=Undefined
  Minimum=0.000, Maximum=253.000, Mean=109.249, StdDev=36.969
  Overviews: 2500x2500, 1250x1250, 625x625
  Overviews: arbitrary
  Metadata:
    STATISTICS_MAXIMUM=253
    STATISTICS_MEAN=109.24947708
    STATISTICS_MINIMUM=0
    STATISTICS_STDDEV=36.968523886498
    STATISTICS_VALID_PERCENT=100
  Image Structure Metadata:
    COMPRESSION=JPEG2000
Band 2 Block=1024x1024 Type=Byte, ColorInterp=Undefined
  Minimum=13.000, Maximum=246.000, Mean=102.733, StdDev=24.345
  Overviews: 2500x2500, 1250x1250, 625x625
  Overviews: arbitrary
  Metadata:
    STATISTICS_MAXIMUM=246
    STATISTICS_MEAN=102.73308536
    STATISTICS_MINIMUM=13
    STATISTICS_STDDEV=24.344664112182
    STATISTICS_VALID_PERCENT=100
  Image Structure Metadata:
    COMPRESSION=JPEG2000
Band 3 Block=1024x1024 Type=Byte, ColorInterp=Undefined
  Minimum=25.000, Maximum=248.000, Mean=96.956, StdDev=15.531
  Overviews: 2500x2500, 1250x1250, 625x625
  Overviews: arbitrary
  Metadata:
    STATISTICS_MAXIMUM=248
    STATISTICS_MEAN=96.9559938
    STATISTICS_MINIMUM=25
    STATISTICS_STDDEV=15.531376273027
    STATISTICS_VALID_PERCENT=100
  Image Structure Metadata:
    COMPRESSION=JPEG2000

These three bands correspond to R/G/B values of each pixel (i.e. a "normal" image representing what a camera/eye would see), but some rasters (e.g. LANDSAT) have more or fewer than 3 bands, and those bands may represent non-visual information like height.

thatbudakguy commented 4 weeks ago

purl https://purl.stanford.edu/tj974rx7808 includes multispectral imagery from SkySat.