stac-utils / stac-layer

Visualize a STAC Item or Collection on a Leaflet Map
Creative Commons Zero v1.0 Universal
47 stars 11 forks source link

weird display issues with Umbra's open data catalog #61

Open m-mohr opened 1 year ago

m-mohr commented 1 year ago

@cholmes reported in the stac-browser repo at https://github.com/radiantearth/stac-browser/issues/308 :

When I go to Umbra open data in stac browser I get some weird errors on most all the items. See like:

Screenshot 2023-04-19 at 9 02 24 PM

It's at this item - the rendered image is a small square, outside of the bounding box. If I load the cog elsewhere then it matches the bounding box.

Just about every one I've tried (maybe 6 or 7?) seems to have this problem. Except one, that does not display on the map and raises an error about invalid lat/long: https://radiantearth.github.io/stac-browser/#/external/s3.us-west-2.amazonaws.com/umbra-open-data-catalog/stac/2023/2023-04/2023-04-16/ac3c40b6-b517-4661-8039-b1437dd91c56/ac3c40b6-b517-4661-8039-b1437dd91c56.json?.asset=asset-GEC

Note that none of the stac items seem to validate, and I'm happy to go tell them to fix their items (though I'm not sure exactly what the problem is) - but since COG's displayed normally elsewhere it seemed like an issue with stac browser.

Response:

Yeah, there are multiple issues here. The items are invalid and need to be fixed. Once that's done, we can evaluate what goes wrong in stac-layer. We should transfer this issue over to stac-layer and check there what goes wrong.

CloudNiner commented 1 year ago

@m-mohr Andy from Umbra here. We have an internal ticket to address the invalid STAC Item. Whoops! We'll address it when we can and post back, although no guesstimate when that might be.

Otherwise our understanding of the weird display issue is that the underlying renderer for stac-browser doesn't support COGs with geotransforms/rotations: https://github.com/radiantearth/stac-browser/issues/222#issuecomment-1235553985 and https://github.com/stac-utils/stac-layer/issues/49

m-mohr commented 1 year ago

Ah, that sounds reasonable, thanks for the hint.

DanielJDufour commented 1 year ago

Here's the gdalinfo for the COG mentioned here: https://radiantearth.github.io/stac-browser/#/external/s3.us-west-2.amazonaws.com/umbra-open-data-catalog/stac/2023/2023-04/2023-04-01/fc889f60-1e9f-45d4-8b8a-0db999e8a6cc/fc889f60-1e9f-45d4-8b8a-0db999e8a6cc.json

Driver: GTiff/GeoTIFF
Files: /Users/danieldufour/Downloads/2023-04-01-04-46-21_UMBRA-04_GEC.tiff
Size is 13176, 13176
Coordinate System is:
PROJCRS["WGS 84 / UTM zone 11N",
    BASEGEOGCRS["WGS 84",
        DATUM["World Geodetic System 1984",
            ELLIPSOID["WGS 84",6378137,298.257223563,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",4326]],
    CONVERSION["UTM zone 11N",
        METHOD["Transverse Mercator",
            ID["EPSG",9807]],
        PARAMETER["Latitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",-117,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["Scale factor at natural origin",0.9996,
            SCALEUNIT["unity",1],
            ID["EPSG",8805]],
        PARAMETER["False easting",500000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]]],
    CS[Cartesian,2],
        AXIS["(E)",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["(N)",north,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    USAGE[
        SCOPE["Engineering survey, topographic mapping."],
        AREA["Between 120°W and 114°W, northern hemisphere between equator and 84°N, onshore and offshore. Canada - Alberta; British Columbia (BC); Northwest Territories (NWT); Nunavut. Mexico. United States (USA)."],
        BBOX[0,-120,84,-114]],
    ID["EPSG",32611]]
Data axis to CRS axis mapping: 1,2
GeoTransform =
  361344.2395924175, 0.08015620933322706, -0.2927568665711126
  4364430.847177379, -0.2927568665710993, -0.08015620933323149
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_RESOLUTIONUNIT=1 (unitless)
  TIFFTAG_XRESOLUTION=1
  TIFFTAG_YRESOLUTION=1
Image Structure Metadata:
  INTERLEAVE=BAND
  LAYOUT=COG
Corner Coordinates:
Upper Left  (  361344.240, 4364430.847) (118d36'38.68"W, 39d25' 5.74"N)
Lower Left  (  357486.875, 4363374.709) (118d39'19.12"W, 39d24'29.23"N)
Upper Right (  362400.378, 4360573.483) (118d35'51.67"W, 39d23' 1.27"N)
Lower Right (  358543.013, 4359517.344) (118d38'32.04"W, 39d22'24.78"N)
Center      (  359943.626, 4361974.096) (118d37'35.38"W, 39d23'45.26"N)
Band 1 Block=512x512 Type=Byte, ColorInterp=Gray
  Overviews: 6588x6588, 3294x3294, 1647x1647, 823x823, 411x411
DanielJDufour commented 1 year ago

@CloudNiner , your diagnosis is correct. The underlying client-side visualization library https://github.com/geotiff/georaster-layer-for-leaflet doesn't support GeoTransform.

I definitely need to update stac-layer to identify and skip GeoTIFFs that have a GeoTransform, so there isn't a bad visualization.

DanielJDufour commented 1 year ago

@CloudNiner , would it be okay with you if I added a downsampled version of this COG to https://github.com/geotiff/test-data ? Once I add it there, it'll be easy to use it for testing in stac-layer, georaster-layer-for-leaflet, and all their geotiff-related dependencies that use https://github.com/geotiff/test-data

CloudNiner commented 1 year ago

@DanielJDufour go for it! All of the Umbra sample data is released under CC-by-4.0: https://umbra.space/open-data

DanielJDufour commented 1 year ago

Just a heads up that I've added an Umbra image of Mount Yasur to https://github.com/GeoTIFF/test-data. Thank you!