2

Context

I'd like to use the WMTS from a QGIS server to serve a raster image as a base map in OpenStreetMap.

Description of the issue

I have set up a QGIS server to serve my raster image. Both WMS and WMTS work great.

I have a WMTS URL given in Key=Value format:

http://{baseurl}/?service=WMTS&VERSION=1.3.0&request=GetCapabilities

which gives me the associated xml file with all the capabilities of my WMTS (provided by QGIS server). It works great. And I can see tiles by querying them with a GetTile request.

Now I would like to be able to use the RESTful version of this URL in order to use it, e.g. as a base map to work with OSM for example.

So I tried:

http://{baseurl}/1.3.0/WMTSCapabilities.xml

But this gives me:

Service unknown or unsupported


This is how the WMTS is configured in my `project.qgs` file:

WMTS options in the QGIS project file

And this what the server tells while it is receiving the request:

qgisserver_1  | 10:27:41 INFO Server[79]: ******************** New request ***************                                                   
qgisserver_1  | 10:27:41 INFO Server[79]: Request URL: http://{baseurl}/1.3.0/WMTSCapabilities.xml?                                    
qgisserver_1  | 10:27:41 INFO Server[79]: Environment:                                                                                       
qgisserver_1  | 10:27:41 INFO Server[79]: ------------------------------------------------                                                   
qgisserver_1  | 10:27:41 INFO Server[79]: SERVER_NAME: {baseurl}                                                                       
qgisserver_1  | 10:27:41 INFO Server[79]: REQUEST_URI: /1.3.0/WMTSCapabilities.xml                                                           
qgisserver_1  | 10:27:41 INFO Server[79]: SCRIPT_NAME: /1.3.0/WMTSCapabilities.xml                                                           
qgisserver_1  | 10:27:41 INFO Server[79]: REMOTE_ADDR: {baseip}                                                                       
qgisserver_1  | 10:27:41 INFO Server[79]: SERVER_PORT: 80                                                                                    
qgisserver_1  | 10:27:41 INFO Server[79]: QUERY_STRING:                                                                                      
qgisserver_1  | 10:27:41 INFO Server[79]: REQUEST_METHOD: GET                                                                                
qgisserver_1  | 10:27:41 INFO Server[79]: HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8            
qgisserver_1  | 10:27:41 INFO Server[79]: HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 10.0; ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83. 
0.4086.0 Safari/537.36                                                                      
qgisserver_1  | 10:27:41 INFO Server[79]: QGIS_PROJECT_FILE: /etc/qgisserver/project.qgs
qgisserver_1  | 10:27:41 INFO Server[79]: Trying URL path: /1.3.0/WMTSCapabilities.xml for /wfs3
qgisserver_1  | 10:27:41 WARNING [79]: Service  is not registered                                                                            
qgisserver_1  | 10:27:41 WARNING Server[79]: <ServiceExceptionReport version="1.3.0" xmlns="http://www.opengis.net/ogc">                     
qgisserver_1  |  <ServiceException code="Service configuration error">Service unknown or unsupported</ServiceException>                      
qgisserver_1  | </ServiceExceptionReport>                                                                                                    
qgisserver_1  |                                                                                                                              
qgisserver_1  | 1626 - 10.192.90.216 - - [02/Jul/2020:10:27:41 +0000] "GET /1.3.0/WMTSCapabilities.xml HTTP/1.1" 200 432 "-" "Mozilla/5.0    
(Windows NT 10.0; ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4086.0 Safari/537.36"
qgisserver_1  | 10:27:41 INFO Server[79]: Request finished in 1 ms                                                                           

This RESTful implementation is defined on page 61 of the OGC document titled "OpenGIS Web Map Tile Service Implementation Standard":

OGC RESTful URL for WMTSCapabilities.xml

Question

Am I missing something / doing something wrong?
The panel dealing with WMTS in my QGIS project does not have much options and none of them is related to RESTful formatting of the URL.

  • Do you have a real live url for an example?. QGIS reads all of the above. – Mapperz Jul 1 at 23:17
  • It's not published yet (internal research work). But the issue here is not getting QGIS reading a WMTS, but my web browser getting access to tiles served by QGIS server. It can fetch the tiles while requests URL are given in KVP mode, but it cannot in a RESTful format (for the exact same parameters), giving me the above message. – s.k Jul 2 at 7:42
  • Just checking are you supplying the MAP parameter also when testing? In the docs it says it is required: docs.qgis.org/testing/en/docs/user_manual/working_with_ogc/… – djq Jul 3 at 9:24
  • As the MAP is a unix path with folder names separated by slashes, I guess it can never work (I tried some ways, but none worked actually). And as stated by the doc: "However, the QGIS_PROJECT_FILE environment variable may be used to define a default QGIS project. In this specific case, MAP is not longer a required parameter." + more info here – s.k Jul 3 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.