Skip to content

Commit

Permalink
update OGC API - Feature to official shortname (#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Aug 2, 2022
1 parent ed51f94 commit caed374
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 27 deletions.
6 changes: 3 additions & 3 deletions GeoHealthCheck/config_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
'GeoHealthCheck.plugins.probe.http',
'GeoHealthCheck.plugins.probe.sta',
'GeoHealthCheck.plugins.probe.wmsdrilldown',
'GeoHealthCheck.plugins.probe.wfs3',
'GeoHealthCheck.plugins.probe.ogcfeat',
'GeoHealthCheck.plugins.probe.ogc3dtiles',
'GeoHealthCheck.plugins.probe.esrifs',
'GeoHealthCheck.plugins.probe.ghcreport',
Expand Down Expand Up @@ -160,8 +160,8 @@
'OGC:STA': {
'probe_class': 'GeoHealthCheck.plugins.probe.sta.StaCaps'
},
'OGC:WFS3': {
'probe_class': 'GeoHealthCheck.plugins.probe.wfs3.WFS3Caps'
'OGCFeat': {
'probe_class': 'GeoHealthCheck.plugins.probe.ogcfeat.OGCFeatCaps'
},
'OGC:3DTiles': {
'probe_class': 'GeoHealthCheck.plugins.probe.ogc3dtiles.OGC3DTiles'
Expand Down
2 changes: 1 addition & 1 deletion GeoHealthCheck/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
'label': 'SensorThings API (STA)',
'versions': ['1.0']
},
'OGC:WFS3': {
'OGCFeat': {
'label': 'OGC API Features (OAFeat)'
},
'OGC:3DTiles': {
Expand Down
4 changes: 2 additions & 2 deletions GeoHealthCheck/healthcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def sniff_test_resource(config, resource_type, url):
'OGC:WPS': [WebProcessingService],
'OGC:CSW': [CatalogueServiceWeb],
'OGC:SOS': [SensorObservationService],
'OGC:WFS3': [urlopen],
'OGCFeat': [urlopen],
'OGC:3DTiles': [urlopen],
'ESRI:FS': [urlopen],
'OGC:STA': [urlopen],
Expand Down Expand Up @@ -241,7 +241,7 @@ def sniff_test_resource(config, resource_type, url):
elif resource_type.startswith(('OGC:', 'OSGeo', 'ESRI')):
if resource_type == 'OGC:STA':
title = 'OGC STA'
elif resource_type == 'OGC:WFS3':
elif resource_type == 'OGCFeat':
title = 'OGC API Features (OAFeat)'
elif resource_type == 'ESRI:FS':
title = 'ESRI ArcGIS FS'
Expand Down
2 changes: 1 addition & 1 deletion GeoHealthCheck/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def run_count(self):
def get_capabilities_url(self):
if self.resource_type.startswith('OGC:') \
and self.resource_type not in \
['OGC:STA', 'OGC:WFS3', 'ESRI:FS', 'OGC:3DTiles']:
['OGC:STA', 'OGCFeat', 'ESRI:FS', 'OGC:3DTiles']:
url = '%s%s' % (bind_url(self.url),
RESOURCE_TYPES[self.resource_type]['capabilities'])
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
from GeoHealthCheck.result import Result, push_result


class WFS3Caps(Probe):
"""Probe for OGC WFS3 API (OAFeat) main endpoint url"""
class OGCFeatCaps(Probe):
"""Probe for OGC API - Features endpoint url"""

NAME = 'OGC API Features (OAFeat) Capabilities'
DESCRIPTION = 'Validate OGC API Features (OAFeat) ' \
'endpoint landing page'
RESOURCE_TYPE = 'OGC:WFS3'
RESOURCE_TYPE = 'OGCFeat'

REQUEST_METHOD = 'GET'
REQUEST_HEADERS = {'Accept': 'application/json'}
Expand Down Expand Up @@ -59,19 +59,17 @@ def set_accept_header(oa_feat, content_type):
oa_feat.headers['Accept'] = content_type


class WFS3Drilldown(Probe):
class OGCFeatDrilldown(Probe):
"""
Probe for OGC API Features (OAFeat) endpoint "drilldown" or
"crawl": starting with top endpoint: get Collections and fetch
Features on them etc. Uses the OWSLib owslib.ogcapi package.
TODO: class needs renaming: WFS3 is now OAFeat.
"""

NAME = 'OGC API Features (OAFeat) Drilldown'
DESCRIPTION = 'Traverses an OGC API Features (OAFeat) API ' \
'endpoint by drilling down'
RESOURCE_TYPE = 'OGC:WFS3'
RESOURCE_TYPE = 'OGCFeat'

REQUEST_METHOD = 'GET'
REQUEST_HEADERS = {'Accept': 'application/json'}
Expand Down Expand Up @@ -261,7 +259,7 @@ def perform_request(self):
self.result.add_result(result)


class WFS3OpenAPIValidator(Probe):
class OGCFeatOpenAPIValidator(Probe):
"""
Probe for OGC API Features (OAFeat) OpenAPI Document Validation.
Uses https://pypi.org/project/openapi-spec-validator/.
Expand All @@ -271,7 +269,7 @@ class WFS3OpenAPIValidator(Probe):
NAME = 'OGC API Features (OAFeat) OpenAPI Validator'
DESCRIPTION = 'Validates OGC API Features (OAFeat) api endpoint for ' \
'OpenAPI compliance'
RESOURCE_TYPE = 'OGC:WFS3'
RESOURCE_TYPE = 'OGCFeat'
REQUEST_HEADERS = {'Accept': 'application/json'}

REQUEST_METHOD = 'GET'
Expand Down Expand Up @@ -344,7 +342,7 @@ def perform_request(self):
#
# NAME = 'OGC API Features Collection'
# DESCRIPTION = 'Validate an OGC API Features Collection'
# RESOURCE_TYPE = 'OGC:WFS3'
# RESOURCE_TYPE = 'OGCFeat'
#
# REQUEST_METHOD = 'GET'
#
Expand Down
16 changes: 8 additions & 8 deletions docs/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ See an example for both below from `config_main.py` for **GHC_PLUGINS** and **GH
'GeoHealthCheck.plugins.probe.http',
'GeoHealthCheck.plugins.probe.sta',
'GeoHealthCheck.plugins.probe.wmsdrilldown',
'GeoHealthCheck.plugins.probe.wfs3',
'GeoHealthCheck.plugins.probe.ogcfeat',

# Checks
'GeoHealthCheck.plugins.check.checks',
Expand Down Expand Up @@ -336,12 +336,12 @@ See an example for both below from `config_main.py` for **GHC_PLUGINS** and **GH
'OGC:STA': {
'probe_class': 'GeoHealthCheck.plugins.probe.sta.StaCaps'
},
'OGC:WFS3': {
'probe_class': 'GeoHealthCheck.plugins.probe.wfs3.WFS3Drilldown'
},
'ESRI:FS': {
'probe_class': 'GeoHealthCheck.plugins.probe.esrifs.ESRIFSDrilldown'
},
'OGCFeat': {
'probe_class': 'GeoHealthCheck.plugins.probe.ogcfeat.OGCFeatDrilldown'
},
'ESRI:FS': {
'probe_class': 'GeoHealthCheck.plugins.probe.esrifs.ESRIFSDrilldown'
},
'urn:geoss:waf': {
'probe_class': 'GeoHealthCheck.plugins.probe.http.HttpGet'
},
Expand Down Expand Up @@ -457,7 +457,7 @@ to override any of the `Probe` baseclass methods.
:members:
:show-inheritance:

.. automodule:: GeoHealthCheck.plugins.probe.wfs3
.. automodule:: GeoHealthCheck.plugins.probe.ogcfeat
:members:
:show-inheritance:

Expand Down
4 changes: 2 additions & 2 deletions tests/data/fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
},
"LDPROXY FEATURES": {
"owner": "admin",
"resource_type": "OSGeo:WFS3",
"resource_type": "OGCFeat",
"active": true,
"title": "LDproxy Daraa",
"url": "https://demo.ldproxy.net/daraa",
Expand Down Expand Up @@ -292,7 +292,7 @@
},
"LDPROXY - Drilldown": {
"resource": "LDPROXY FEATURES",
"probe_class": "GeoHealthCheck.plugins.probe.wfs3.WFS3Drilldown",
"probe_class": "GeoHealthCheck.plugins.probe.ogcfeat.OGCFeatDrilldown",
"parameters": {
"drilldown_level": "full"
}
Expand Down

0 comments on commit caed374

Please sign in to comment.