Skip to content

feat: add /concept_metadata and /compatibility endpoints#80

Merged
hrodmn merged 4 commits intodevelopfrom
feat/compatibility
Oct 15, 2025
Merged

feat: add /concept_metadata and /compatibility endpoints#80
hrodmn merged 4 commits intodevelopfrom
feat/compatibility

Conversation

@hrodmn
Copy link
Contributor

@hrodmn hrodmn commented Oct 9, 2025

These new endpoints combine some collection-level metadata and a guess-and-check test on the first granule that comes back in a basic search to determine which backend (rasterio or xarray) is appropriate for the concept id, as well as other helpful information for setting the query parameters (e.g. sel).

Here is the example output for a netcdf dataset:

curl "http://localhost:8000/compatibility?concept_id=C2837626477-GES_DISC" | jq
{
  "concept_id": "C2837626477-GES_DISC",
  "backend": "xarray",
  "datetime": [
    {
      "RangeDateTimes": [
        {
          "BeginningDateTime": "2005-01-01T00:00:00.000Z",
          "EndingDateTime": "2021-12-31T23:59:59.999Z"
        }
      ],
      "EndsAtPresentFlag": true
    }
  ],
  "variables": {
    "o3": {
      "shape": [
        12,
        27,
        160,
        320
      ],
      "dtype": "float32"
    }
  },
  "dimensions": {
    "time": 12,
    "nv": 2,
    "lon": 320,
    "lat": 160,
    "lev": 27
  },
  "coordinates": {
    "time": {
      "size": 12,
      "dtype": "datetime64[ns]"
    },
    "time_bnds": {
      "size": 24,
      "dtype": "datetime64[ns]"
    },
    "lon": {
      "size": 320,
      "dtype": "float32",
      "min": 0.0,
      "max": 358.875
    },
    "lon_bnds": {
      "size": 640,
      "dtype": "float32",
      "min": 0.5625,
      "max": 359.4375
    },
    "lat": {
      "size": 160,
      "dtype": "float32",
      "min": -89.14199829101562,
      "max": 89.14199829101562
    },
    "lat_bnds": {
      "size": 320,
      "dtype": "float32",
      "min": -89.69850158691406,
      "max": 89.69850158691406
    },
    "lev": {
      "size": 27,
      "dtype": "float32",
      "min": 60.0,
      "max": 1000.0
    }
  },
  "example_assets": "https://data.gesdisc.earthdata.nasa.gov/data/TCR2_MON_VERTCONCS/TRPSCRO3M3D.1/TROPESS_reanalysis_mon_o3_2005.nc"
}

If the dataset is raster-type (e.g. HLS) the information is not quite as rich, but should help users get un-stuck by showing the asset names which can help determine band_regex.

curl "http://localhost:8000/compatibility?concept_id=C2021957657-LPCLOUD" | jq
{
  "concept_id": "C2021957657-LPCLOUD",
  "backend": "rasterio",
  "datetime": [
    {
      "RangeDateTimes": [
        {
          "BeginningDateTime": "2013-04-11T00:00:00.000Z"
        }
      ],
      "EndsAtPresentFlag": true,
      "PrecisionOfSeconds": 0,
      "TemporalResolution": {
        "Value": 1,
        "Unit": "Day"
      }
    }
  ],
  "example_assets": {
    "HLS.L30.T59WPT.2013101T001445.v2.0.B09.tif": "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T59WPT.2013101T001445.v2.0/HLS.L30.T59WPT.2013101T001445.v2.0.B09.tif",
    "HLS.L30.T59WPT.2013101T001445.v2.0.Fmask.tif": "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T59WPT.2013101T001445.v2.0/HLS.L30.T59WPT.2013101T001445.v2.0.Fmask.tif",
    "HLS.L30.T59WPT.2013101T001445.v2.0.B06.tif": "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T59WPT.2013101T001445.v2.0/HLS.L30.T59WPT.2013101T001445.v2.0.B06.tif",
    "HLS.L30.T59WPT.2013101T001445.v2.0.B01.tif": "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T59WPT.2013101T001445.v2.0/HLS.L30.T59WPT.2013101T001445.v2.0.B01.tif",
    "HLS.L30.T59WPT.2013101T001445.v2.0.B07.tif": "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T59WPT.2013101T001445.v2.0/HLS.L30.T59WPT.2013101T001445.v2.0.B07.tif",
    "HLS.L30.T59WPT.2013101T001445.v2.0.VZA.tif": "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T59WPT.2013101T001445.v2.0/HLS.L30.T59WPT.2013101T001445.v2.0.VZA.tif",
    "HLS.L30.T59WPT.2013101T001445.v2.0.B10.tif": "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T59WPT.2013101T001445.v2.0/HLS.L30.T59WPT.2013101T001445.v2.0.B10.tif",
    "HLS.L30.T59WPT.2013101T001445.v2.0.B04.tif": "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T59WPT.2013101T001445.v2.0/HLS.L30.T59WPT.2013101T001445.v2.0.B04.tif",
    "HLS.L30.T59WPT.2013101T001445.v2.0.SAA.tif": "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T59WPT.2013101T001445.v2.0/HLS.L30.T59WPT.2013101T001445.v2.0.SAA.tif",
    "HLS.L30.T59WPT.2013101T001445.v2.0.VAA.tif": "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T59WPT.2013101T001445.v2.0/HLS.L30.T59WPT.2013101T001445.v2.0.VAA.tif",
    "HLS.L30.T59WPT.2013101T001445.v2.0.B05.tif": "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T59WPT.2013101T001445.v2.0/HLS.L30.T59WPT.2013101T001445.v2.0.B05.tif",
    "HLS.L30.T59WPT.2013101T001445.v2.0.SZA.tif": "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T59WPT.2013101T001445.v2.0/HLS.L30.T59WPT.2013101T001445.v2.0.SZA.tif",
    "HLS.L30.T59WPT.2013101T001445.v2.0.B02.tif": "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T59WPT.2013101T001445.v2.0/HLS.L30.T59WPT.2013101T001445.v2.0.B02.tif",
    "HLS.L30.T59WPT.2013101T001445.v2.0.B03.tif": "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T59WPT.2013101T001445.v2.0/HLS.L30.T59WPT.2013101T001445.v2.0.B03.tif",
    "HLS.L30.T59WPT.2013101T001445.v2.0.B11.tif": "https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T59WPT.2013101T001445.v2.0/HLS.L30.T59WPT.2013101T001445.v2.0.B11.tif"
  },
  "sample_asset_raster_info": {
    "bounds": [
      600000.0,
      7690200.0,
      709800.0,
      7800000.0
    ],
    "crs": "PROJCS[\"UTM Zone 59, Northern Hemisphere\",GEOGCS[\"Unknown datum based upon the WGS 84 ellipsoid\",DATUM[\"Not specified (based on WGS 84 spheroid)\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",171],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]",
    "band_metadata": [
      [
        "b1",
        {}
      ]
    ],
    "band_descriptions": [
      [
        "b1",
        "Cirrus"
      ]
    ],
    "dtype": "int16",
    "nodata_type": "Nodata",
    "colorinterp": [
      "gray"
    ],
    "scales": [
      0.0001
    ],
    "offsets": [
      0.0
    ],
    "driver": "GTiff",
    "count": 1,
    "width": 3660,
    "height": 3660,
    "overviews": [
      2,
      4,
      8,
      16
    ],
    "nodata_value": -9999.0
  }
}

I also added the /concept_metadata which just returns the collection/concept metadata direct from CMR.

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

📚 Documentation preview will be available at: https://developmentseed.github.io/titiler-cmr/pr-previews/pr-80/

Status: ✅ Preview is ready!

github-actions bot pushed a commit that referenced this pull request Oct 9, 2025
@hrodmn hrodmn self-assigned this Oct 9, 2025
github-actions bot pushed a commit that referenced this pull request Oct 10, 2025
github-actions bot pushed a commit that referenced this pull request Oct 10, 2025
github-actions bot pushed a commit that referenced this pull request Oct 10, 2025
@hrodmn hrodmn merged commit f3c43d4 into develop Oct 15, 2025
7 checks passed
@hrodmn hrodmn deleted the feat/compatibility branch October 15, 2025 16:15
github-actions bot pushed a commit that referenced this pull request Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants