File tree Expand file tree Collapse file tree 6 files changed +583
-2
lines changed Expand file tree Collapse file tree 6 files changed +583
-2
lines changed Original file line number Diff line number Diff line change 104
104
# Probes
105
105
'GeoHealthCheck.plugins.probe.owsgetcaps' ,
106
106
'GeoHealthCheck.plugins.probe.wms' ,
107
+ 'GeoHealthCheck.plugins.probe.wmts' ,
107
108
'GeoHealthCheck.plugins.probe.wfs' ,
108
109
'GeoHealthCheck.plugins.probe.tms' ,
109
110
'GeoHealthCheck.plugins.probe.http' ,
Original file line number Diff line number Diff line change @@ -158,6 +158,29 @@ def __init__(self):
158
158
})
159
159
"""Param defs"""
160
160
161
+ # This is to catch errors because url is only accessible through REST
162
+ # owslib will always do KVP request and this way the GetCap url will be:
163
+ # .../1.0.0/WMTSCapabilities.xml?service=WMTS&version=1.0.0&
164
+ # request=GetCapabilities
165
+ # This new request will return a valid WebMapTileService object.
166
+ def before_request (self ):
167
+ self .original_url = self ._resource .url
168
+
169
+ try :
170
+ response = Probe .perform_get_request (self , self ._resource .url )
171
+ except Exception :
172
+ self ._resource .url = self ._resource .url + \
173
+ '/1.0.0/WMTSCapabilities.xml'
174
+ return
175
+
176
+ if (response .status_code != 200 and
177
+ '<ServiceException' in response .text ):
178
+ self ._resource .url = self ._resource .url + \
179
+ '/1.0.0/WMTSCapabilities.xml'
180
+
181
+ def after_request (self ):
182
+ self ._resource .url = self .original_url
183
+
161
184
162
185
class WpsGetCaps (OwsGetCaps ):
163
186
"""WPS GetCapabilities Probe"""
You can’t perform that action at this time.
0 commit comments