Rerunning makeGeotiff.py for new location image - WMTS error

Hello,
I’m rerunning the provided stock makeGeotiff.py script used several months ago, now with new coordinates. conda is installed, I’ve created and activated myLandsatPics, and
conda install -c conda-forge cartopy gdal OWSLib scipy

Now, when I python the makeGeotiff.py script, I get:

python mG_prk.py
~/anaconda3/envs/myLandsatPics/lib/python3.12/site-packages/owslib/wmts.py:856: FutureWarning: The behavior of this method will change in future versions. Use specific ‘len(elem)’ or ‘elem is not None’ test instead.
if current and current.text == ‘true’:
~/anaconda3/envs/myLandsatPics/lib/python3.12/site-packages/owslib/wmts.py:653: RuntimeWarning: TileMatrixLimits with tileMatrix “1” already exists
warnings.warn(msg, RuntimeWarning)
~/anaconda3/envs/myLandsatPics/lib/python3.12/site-packages/owslib/wmts.py:653: RuntimeWarning: TileMatrixLimits with tileMatrix “2” already exists
warnings.warn(msg, RuntimeWarning)
~/anaconda3/envs/myLandsatPics/lib/python3.12/site-packages/owslib/wmts.py:653: RuntimeWarning: TileMatrixLimits with tileMatrix “3” already exists
warnings.warn(msg, RuntimeWarning)
~/anaconda3/envs/myLandsatPics/lib/python3.12/site-packages/owslib/wmts.py:653: RuntimeWarning: TileMatrixLimits with tileMatrix “4” already exists
warnings.warn(msg, RuntimeWarning)
~/anaconda3/envs/myLandsatPics/lib/python3.12/site-packages/owslib/wmts.py:653: RuntimeWarning: TileMatrixLimits with tileMatrix “5” already exists
warnings.warn(msg, RuntimeWarning)
~/anaconda3/envs/myLandsatPics/lib/python3.12/site-packages/owslib/wmts.py:653: RuntimeWarning: TileMatrixLimits with tileMatrix “6” already exists
warnings.warn(msg, RuntimeWarning)
Traceback (most recent call last):
File “mG_prk.py”, line 67, in
ax.add_wmts(url, layer)
File “~/anaconda3/envs/myLandsatPics/lib/python3.12/site-packages/cartopy/mpl/geoaxes.py", line 2257, in add_wmts
wmts = WMTSRasterSource(wmts, layer_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “~/anaconda3/envs/myLandsatPics/lib/python3.12/site-packages/cartopy/io/ogc_clients.py", line 379, in init
wmts = owslib.wmts.WebMapTileService(wmts)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “~/anaconda3/envs/myLandsatPics/lib/python3.12/site-packages/owslib/wmts.py", line 197, in init
self._buildMetadata(parse_remote_metadata)
File “~/anaconda3/envs/myLandsatPics/lib/python3.12/site-packages/owslib/wmts.py", line 248, in _buildMetadata
gather_layers(caps, None)
File “~/anaconda3/envs/myLandsatPics/lib/python3.12/site-packages/owslib/wmts.py", line 239, in gather_layers
cm = ContentMetadata(
^^^^^^^^^^^^^^^^
File “~/anaconda3/envs/myLandsatPics/lib/python3.12/site-packages/owslib/wmts.py", line 819, in init
raise ValueError(
ValueError: <Element {http://www.opengis.net/wmts/1.0}Dimension at 0x15365fa80> list of values can not be empty

Does anyone have an idea where this went wrong, please, and how to fix it?

Hi @Ihp , sorry for the late reply, but our python expert is looking into it! I’ll keep you posted on what he finds out!

Hi @ihp, could you send your script so we can see your modifications?

Hi @StasJ,

Thank you! (I don’t see a file uplink so put it on google drive.)

@Ihp You need to make sure you are using the latest versions of all of the required libraries. If you create a new conda environment with the following libraries it will work: cartopy gdal scipy