TransWikia.com

Cannot connect to WMTS layer from NASA GIBS API in QGIS

Geographic Information Systems Asked on June 14, 2021

QGIS Version: 2.18.3

I am trying to add some basemaps layers from NASA’s GIBS API, but I cannot seem to get the URL right to connect to it.

According to the site, I think I should just be able to use the REST endpoint at https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/ Under “Add Layers from a WM(T)S Server” in QGIS. When I do this, however it is not recognized as a
WMS server, because I get the error “The server you are trying to connect to does not seem to be a WMS server. Please check the URL.”.

If I try the GetCapabilities link at https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/1.0.0/WMTSCapabilities.xml, then I do get a list of services to choose from, but the map canvas is blank when I try to add anything.

The Layer Properties then shows this under the General > Layer Source tab:

contextualWMSLegend=0&crs=EPSG:4326&dpiMode=7&featureCount=10&format=image/png&layers=VIIRS_Night_Lights&styles=default&tileDimensions=time%3D2016-01-01/2016-01-01/P1Y&tileMatrixSet=500m&url=https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/1.0.0/WMTSCapabilities.xml

Specifically I am trying to add the “Night Lights” layer.

3 Answers

As an alternative you could use the Generic XYZ Tiles as documented.

QGIS 3.x

  • Open Browser
  • Right Click Tile Server (XYZ)
  • Click "New connection..."
  • Enter Name, Url and set zoomlevels.
  • Click "OK".
  • Double click on the new layer to add to map.

QGIS 2.x

  • Open "Browser Panel"
  • Right click "Tile Server (XYZ)"
  • Click "New connection..."
  • Insert XYZ tile layer URL, click "OK".
  • Enter name, click "OK".
  • Double click on the new layer to add to map.

You need to study the GetCapabilities a bit for the exact parameters but I worked some out:

VIIRS_Night_Lights https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/VIIRS_Night_Lights/default/default/GoogleMapsCompatible_Level8/{z}/{y}/{x}.png

VIIRS_Black_Marble: https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/VIIRS_Black_Marble/default/default/GoogleMapsCompatible_Level8/{z}/{y}/{x}.png

The syntax is: https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/VIIRS_Black_Marble/default/Dimension/TileMatrixSet/{z}/{y}/{x}.png

You need to look up the Dimension:

...
<Dimension>
  <ows:Identifier>time</ows:Identifier>
  <ows:UOM>ISO8601</ows:UOM>
  <Default>2016-01-01</Default>
  <Current>false</Current>
  <Value>2012-01-01/2012-01-01/P1Y</Value>
  <Value>2016-01-01/2016-01-01/P1Y</Value>
</Dimension>
...

And the TileMatrixSet:

...
<TileMatrixSetLink>
  <TileMatrixSet>GoogleMapsCompatible_Level8</TileMatrixSet>
</TileMatrixSetLink>
...

Setting Dimension to Default will result in the most recent set available.

QGIS 3 with VIIRS_Black_Marble layer

Correct answer by nielsgerrits on June 14, 2021

I can get some of the layers from this server to work as WMTS layers in QGIS, however some don't seem to work. These seem to be the ones which have a time variable in the WMTS template URL. It seems that QGIS doesn't recognise this and leaves it out of the request.

A quick Google turns up this known bug.

Answered by Ian Turton on June 14, 2021

The QGIS 3.14 release has added support for time-varying WMS layers. And in the intervening time since this question was initially posted, NASA GIBS has opened up public access to their visualizations via WMS. Information for how to register the GIBS WMS endpoints in QGIS can be found here.

Note that QGIS support of time-varying WMTS layers is not functional at this time.

Answered by Matt Cechini on June 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP