Tile metadata in the GetCapabilities file
Posted: Thu Jun 10, 2021 1:13 pm America/New_York
I emailed support and thought I'd post here as well.
I'm learning the basics of querying a WMTS server. There is a python library to do this but there must've been server side changes, as a query that once worked:
https://gitc.earthdata.nasa.gov/wmts/epsg4326/best/wmts.cgi?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=Landsat_WELD_CorrectedReflectance_TrueColor_Global_Annual&STYLE=default&TILEMATRIXSET=31.25m&TILEMATRIX=6&TILEROW=12&TILECOL=11&FORMAT=image/jpeg
is broken.
Take the Landsat_WELD_CorrectedReflectance_TrueColor_Global_Annual image. I want to extract a region around some lon, lat. My understanding is that I need to determine the tile matrix, tile row, and tile col containing the lon and lat. For that I need the pixel scale (arcsec probably?) and tile dimensions. First question: where are these data?
I've parsed the GetCapabilities file.
>>> import requests
>>> from xml.etree import ElementTree
>>> xml_url = "https://gibs.earthdata.nasa.gov (/wmts/epsg4326/best/1.0.0/)"
"WMTSCapabilities.xml")
>>> resp = requests.get(xml_url)
>>> xml = ElementTree.fromstring(resp.content)
>>> contents = xml[-2]
>>> layer = contents.findall(".//*[.='Landsat_WELD_CorrectedReflectance_TrueColor_Global_Annual']..")[0]
Section 6.1 of the WMTS implementation standard has that TileMatrixSetLink has most (all?) of the parameters I need to determine which tiles to get. But the GetCapabilities file has only the pixel scale in meters:
>>> layer[5][0].tag
'{LINK} .opengis.net/wmts/1.0}TileMatrixSet'
>>> layer[5][0].text
'31.25m'
>>> layer[5][0].attrib
{}
Are the metadata supposed to be there?
I have other questions but I'll pose those later.
I'm learning the basics of querying a WMTS server. There is a python library to do this but there must've been server side changes, as a query that once worked:
https://gitc.earthdata.nasa.gov/wmts/epsg4326/best/wmts.cgi?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=Landsat_WELD_CorrectedReflectance_TrueColor_Global_Annual&STYLE=default&TILEMATRIXSET=31.25m&TILEMATRIX=6&TILEROW=12&TILECOL=11&FORMAT=image/jpeg
is broken.
Take the Landsat_WELD_CorrectedReflectance_TrueColor_Global_Annual image. I want to extract a region around some lon, lat. My understanding is that I need to determine the tile matrix, tile row, and tile col containing the lon and lat. For that I need the pixel scale (arcsec probably?) and tile dimensions. First question: where are these data?
I've parsed the GetCapabilities file.
>>> import requests
>>> from xml.etree import ElementTree
>>> xml_url = "https://gibs.earthdata.nasa.gov (/wmts/epsg4326/best/1.0.0/)"
"WMTSCapabilities.xml")
>>> resp = requests.get(xml_url)
>>> xml = ElementTree.fromstring(resp.content)
>>> contents = xml[-2]
>>> layer = contents.findall(".//*[.='Landsat_WELD_CorrectedReflectance_TrueColor_Global_Annual']..")[0]
Section 6.1 of the WMTS implementation standard has that TileMatrixSetLink has most (all?) of the parameters I need to determine which tiles to get. But the GetCapabilities file has only the pixel scale in meters:
>>> layer[5][0].tag
'{LINK} .opengis.net/wmts/1.0}TileMatrixSet'
>>> layer[5][0].text
'31.25m'
>>> layer[5][0].attrib
{}
Are the metadata supposed to be there?
I have other questions but I'll pose those later.