[GeoNetwork-users] Adding a WMTS service as Background map

Hi!

I am setting up a new 4.2.2 Geonetwork server on an Ubuntu 20 server. I
have been running a 4.0 instance on a Windows server for a couple of years.
Being a new version, and a new platform, I have some questions. I will make
a separate thread for each. I have installed the latest geonetwork.war
under Tomcat 9, and done no customizing of the UI.

Adding a WMTS service as Background map

This is done by manual editing of the config-viewer.xml file.

A provided sample for WMTS goes like this

    <ows-context:Layer queryable="false"
                       name="{type=wmts,name=web_mercator_etopo1_hillshade}"
                       hidden="true" opacity="1" group="Background layers">
      <ows:Title xmlns:ows="http://www.opengis.net/ows&quot;&gt;Etopo1&lt;/ows:Title&gt;
      <ows-context:Server service="urn:ogc:serviceType:WMS">
        <ows-context:OnlineResource xmlns:xlink="
http://www.w3.org/1999/xlink&quot;
                                    xlink:href="
http://maps.ngdc.noaa.gov/arcgis/rest/services/web_mercator/etopo1_hillshade/MapServer/WMTS/1.0.0/WMTSCapabilities.xml
"/>
      </ows-context:Server>
      <ows-context:StyleList/>
    </ows-context:Layer>

I have tried to put in my service link on xlink, but get nothing but a hung
spinner where the clickable link should be in the map UI. This goes for all
other attempts, and yes, I have secured that the altered file is read into
the application.

There are a number of strange items in the sample, making me doubt its
validity

It is for an ArcGIS REST service, not an OGC WMTS service. So the href
cannot be a file.

serviceType:WMS should be WMTS, I think but changing does not help.

<ows-context:StyleList/> ought to be where the style should be put, but
that is seldom needed. On the other hand, a tag for Layer Name in the WMTS
service would be useful.

I think I have tried all permutations here, but to no avail.

If someone with a working WMTS background map could provide a little code
snippet it would be most welcome. And perhaps even find its way into the
config file in the repo.

Best regards, Mats.E
--

*GisKraft*, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se

Responding to my own post I forgot to mention two important things.
1/ There is no problem at all adding this WMTS service to the Map from
the + menu. Typing the WMTS service URL immediately responds with the two
layers available in the service.
2/ Debugging with F12 gives no information at all. GN seems satisfied with
the spinner in the dialog and moves on.

I cannot share the WMTS link because it contains a personal token. This is
not the problem though whis is proved by 1 above.
Regards, Mats.E

Den mån 20 mars 2023 kl 23:39 skrev Mats Elfström <mats.elfstrom@...1900...

:

Hi!

I am setting up a new 4.2.2 Geonetwork server on an Ubuntu 20 server. I
have been running a 4.0 instance on a Windows server for a couple of years.
Being a new version, and a new platform, I have some questions. I will make
a separate thread for each. I have installed the latest geonetwork.war
under Tomcat 9, and done no customizing of the UI.

Adding a WMTS service as Background map

This is done by manual editing of the config-viewer.xml file.

A provided sample for WMTS goes like this

    <ows-context:Layer queryable="false"

name="{type=wmts,name=web_mercator_etopo1_hillshade}"
                       hidden="true" opacity="1" group="Background layers">
      <ows:Title xmlns:ows="http://www.opengis.net/ows&quot;&gt;Etopo1&lt;/ows:Title&gt;
      <ows-context:Server service="urn:ogc:serviceType:WMS">
        <ows-context:OnlineResource xmlns:xlink="
http://www.w3.org/1999/xlink&quot;
                                    xlink:href="
http://maps.ngdc.noaa.gov/arcgis/rest/services/web_mercator/etopo1_hillshade/MapServer/WMTS/1.0.0/WMTSCapabilities.xml
"/>
      </ows-context:Server>
      <ows-context:StyleList/>
    </ows-context:Layer>

I have tried to put in my service link on xlink, but get nothing but a
hung spinner where the clickable link should be in the map UI. This goes
for all other attempts, and yes, I have secured that the altered file is
read into the application.

There are a number of strange items in the sample, making me doubt its
validity

It is for an ArcGIS REST service, not an OGC WMTS service. So the href
cannot be a file.

serviceType:WMS should be WMTS, I think but changing does not help.

<ows-context:StyleList/> ought to be where the style should be put, but
that is seldom needed. On the other hand, a tag for Layer Name in the WMTS
service would be useful.

I think I have tried all permutations here, but to no avail.

If someone with a working WMTS background map could provide a little code
snippet it would be most welcome. And perhaps even find its way into the
config file in the repo.

Best regards, Mats.E
--

*GisKraft*, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se

--

*GisKraft*, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se

Hi Mats
Here is an example of how I define a WMTS service as basemap for GN 4.2.2 - the URL doesn’t work as it requires a personal token:

<ows-context:OWSContext xmlns:ows-context="http://www.opengis.net/ows-context&quot;
                        xmlns:ows="http://www.opengis.net/ows&quot;
                        version="0.3.1" id="ows-context-ex-1-v3">
  <ows-context:General>
   <ows:BoundingBox crs="EPSG:3006">
    <ows:LowerCorner>-758731.0206133549 6421418.344896918</ows:LowerCorner>
    <ows:UpperCorner>2092299.1493212816 7469994.344896916</ows:UpperCorner>
  </ows:BoundingBox>
  </ows-context:General>
  <ows-context:ResourceList>
    <ows-context:Layer name="{type=wmts,name=topowebb}"
                       group="Background layers"
                       hidden="false"
                       opacity="1">
      <ows:Title>Topowebb</ows:Title>
      <ows-context:Server service="urn:ogc:serviceType:WMTS">
        <ows-context:OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink&quot; xlink:href="https://api.lantmateriet.se/open/topowebb-ccby/v1/wmts/token/\{api\-token\}/&quot;/&gt;
      </ows-context:Server>
    </ows-context:Layer>
  </ows-context:ResourceList>
</ows-context:OWSContext>

The important parts are :
Ows-context:Layer - the name has to have both type=wmts and the layername you want to use;
Ows-context:Server defines the service type

I have also defined EPSG:3006 in the CatController.js file under switcherProjectionList

Hope this helps.
Mvh
/Pete

-----Ursprungligt meddelande-----
Från: Mats Elfström via GeoNetwork-users <geonetwork-users@lists.sourceforge.net>
Skickat: den 20 mars 2023 23:39
Till: geonetwork-users@lists.sourceforge.net
Ämne: [EXTERNT] [GeoNetwork-users] Adding a WMTS service as Background map

OBS! Detta mejl kommer från en avsändare utanför vår IT-miljö. Klicka inte på länkar och öppna inte bifogade filer om du är osäker på avsändare eller innehåll. Kontakta Service Desk om du behöver råd och stöd.

Hi!

I am setting up a new 4.2.2 Geonetwork server on an Ubuntu 20 server. I have been running a 4.0 instance on a Windows server for a couple of years.
Being a new version, and a new platform, I have some questions. I will make a separate thread for each. I have installed the latest geonetwork.war under Tomcat 9, and done no customizing of the UI.

Adding a WMTS service as Background map

This is done by manual editing of the config-viewer.xml file.

A provided sample for WMTS goes like this

    <ows-context:Layer queryable="false"
                       name="{type=wmts,name=web_mercator_etopo1_hillshade}"
                       hidden="true" opacity="1" group="Background layers">
      <ows:Title xmlns:ows="http://www.opengis.net/ows&quot;&gt;Etopo1&lt;/ows:Title&gt;
      <ows-context:Server service="urn:ogc:serviceType:WMS">
        <ows-context:OnlineResource xmlns:xlink="
http://www.w3.org/1999/xlink&quot;
                                    xlink:href="
http://maps.ngdc.noaa.gov/arcgis/rest/services/web_mercator/etopo1_hillshade/MapServer/WMTS/1.0.0/WMTSCapabilities.xml
"/>
      </ows-context:Server>
      <ows-context:StyleList/>
    </ows-context:Layer>

I have tried to put in my service link on xlink, but get nothing but a hung spinner where the clickable link should be in the map UI. This goes for all other attempts, and yes, I have secured that the altered file is read into the application.

There are a number of strange items in the sample, making me doubt its validity

It is for an ArcGIS REST service, not an OGC WMTS service. So the href cannot be a file.

serviceType:WMS should be WMTS, I think but changing does not help.

<ows-context:StyleList/> ought to be where the style should be put, but that is seldom needed. On the other hand, a tag for Layer Name in the WMTS service would be useful.

I think I have tried all permutations here, but to no avail.

If someone with a working WMTS background map could provide a little code snippet it would be most welcome. And perhaps even find its way into the config file in the repo.

Best regards, Mats.E
--

*GisKraft*, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se

_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork