WMTS provider for NASA Global Imagery Browse Services for EOSDIS

I am trying to use the WMTS service referred to by https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/1.0.0/WMTSCapabilities.xml
The code I am using is:

    const wmtsProvider = new WebMapTileServiceImageryProvider({
          url: 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/wmts.cgi?', //GetTile url
          layer: 'GEDI_ISS_L4B_Aboveground_Biomass_Density_Mean_201904-202303', //Layer Identifier
          style: 'default',
          tileMatrixSetID: '1km',
          format: 'image/png',
          //tilingScheme: new Cesium.GeographicTilingScheme(),
    });

The loaded layer is reprojected in a wrong area. I tried to use a different tilescheme but the result is the same.
I ask you for support to solve this problem that I have encountered for the moment with this WMTS
Thanks in advance.

Not a full answer, but … I was curious, and had a short look:

It should be possible to adjust the area by passing in the right rectangle to the GeographicTilingScheme constructor.

Now… what is the “right” rectangle?

The WMTSCapabilities.xml for that layer says

<ows:WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
  <ows:LowerCorner>-180 -90</ows:LowerCorner>
  <ows:UpperCorner>180 90</ows:UpperCorner>
</ows:WGS84BoundingBox>

which would mean “the whole area”, but… that’s the default, and apparently, not correct.

Websearches yield results with a description of the data source, which say

Spatial Extent

Bounding Box: (52.0°, 180.0°), (-52.0°, -180.0°)

which could be a hint.

Other sources say

GEDI collects data globally between 51.6° N and 51.6° S latitudes

which is in the same ballpark.

I thought that it might be necessary to “invert” that information, and pass in a rectangle that causes this rectangle to be mapped to the full range, but didn’t quickly find the right way to do this.

With a bit of twiddling and trial-and-error, I came up with a rectangle that does not make any sense, at all… but … shows roughly the right mapping:

Maybe it still helps as a hint (and maybe someone can come up with “the right way” for computing “the right rectangle”…).

Thanks, Marco13 for your reply. I made some test, but I can say that in QGIS the layer is well done. I overlapped in QGIS the layer OpenStreetMap and the WMTS and everything is correct. So, I continue to investigate.

I was still curious (although I know that I don’t know much about WMTS providers and such). There seems to be some inconsistency in the projections, and I have not yet looked up all definitions and specifications that may be relevant here.

But when you change epsg4326 to epsg3857 and the tileMatrixSetID from 1km to GoogleMapsCompatible_Level7 (as defined in the XML), then it seems to work as expected:

If that’s not it, someone else might have to provide further help here. There are many projections and tiling schemes… :fearful: