From c9abac21d4b073427604fa96e8e1beead9738d52 Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Mon, 6 Jan 2020 09:40:33 -0500 Subject: [PATCH] CITE fixes and setup (#330) * add CITE testing setup * fix item link relations, handle invalid limit/startindex parameters * ignore all generated OpenAPI files * update config and steps * update config --- .gitignore | 4 +- pygeoapi/api.py | 37 +- tests/cite/ogcapi-features/README.md | 17 + .../canada-hydat-daily-mean-02HC003.json | 1240 +++++++++++++++++ tests/cite/ogcapi-features/cite.config.yml | 99 ++ tests/cite/ogcapi-features/cite.env | 2 + 6 files changed, 1390 insertions(+), 9 deletions(-) create mode 100644 tests/cite/ogcapi-features/README.md create mode 100644 tests/cite/ogcapi-features/canada-hydat-daily-mean-02HC003.json create mode 100644 tests/cite/ogcapi-features/cite.config.yml create mode 100644 tests/cite/ogcapi-features/cite.env diff --git a/.gitignore b/.gitignore index d2a2494d9..06299b0a7 100644 --- a/.gitignore +++ b/.gitignore @@ -101,9 +101,7 @@ ENV/ .mypy_cache/ # pygeoapi artifacts -local.config.yml -local.openapi.yml -openapi.yml +*.openapi.yml # misc *.swp diff --git a/pygeoapi/api.py b/pygeoapi/api.py index b9515112f..b649e210d 100644 --- a/pygeoapi/api.py +++ b/pygeoapi/api.py @@ -343,21 +343,21 @@ def describe_collections(self, headers_, format_, dataset=None): LOGGER.debug('Adding JSON and HTML link relations') collection['links'].append({ 'type': 'application/geo+json', - 'rel': 'item', + 'rel': 'items', 'title': 'Features as GeoJSON', 'href': '{}/collections/{}/items?f=json'.format( self.config['server']['url'], k) }) collection['links'].append({ 'type': 'application/ld+json', - 'rel': 'item', + 'rel': 'items', 'title': 'Features as RDF (GeoJSON-LD)', 'href': '{}/collections/{}/items?f=jsonld'.format( self.config['server']['url'], k) }) collection['links'].append({ 'type': 'text/html', - 'rel': 'item', + 'rel': 'items', 'title': 'Features as HTML', 'href': '{}/collections/{}/items?f=html'.format( self.config['server']['url'], k) @@ -495,8 +495,17 @@ def get_collection_items(self, headers, args, dataset, pathinfo=None): } LOGGER.error(exception) return headers_, 400, json.dumps(exception) - except TypeError: + except (TypeError) as err: + LOGGER.warning(err) startindex = 0 + except ValueError as err: + LOGGER.warning(err) + exception = { + 'code': 'InvalidParameterValue', + 'description': 'startindex value should be an integer' + } + LOGGER.error(exception) + return headers_, 400, json.dumps(exception) LOGGER.debug('Processing limit parameter') try: @@ -510,8 +519,17 @@ def get_collection_items(self, headers, args, dataset, pathinfo=None): } LOGGER.error(exception) return headers_, 400, json.dumps(exception) - except TypeError: + except TypeError as err: + LOGGER.warning(err) limit = int(self.config['server']['limit']) + except ValueError as err: + LOGGER.warning(err) + exception = { + 'code': 'InvalidParameterValue', + 'description': 'limit value should be an integer' + } + LOGGER.error(exception) + return headers_, 400, json.dumps(exception) resulttype = args.get('resulttype') or 'results' @@ -607,7 +625,14 @@ def get_collection_items(self, headers, args, dataset, pathinfo=None): LOGGER.debug('processing property parameters') for k, v in args.items(): - if k not in reserved_fieldnames and k in p.fields.keys(): + if k not in reserved_fieldnames and k not in p.fields.keys(): + exception = { + 'code': 'InvalidParameterValue', + 'description': 'unknown query parameter' + } + LOGGER.error(exception) + return headers_, 400, json.dumps(exception) + elif k not in reserved_fieldnames and k in p.fields.keys(): LOGGER.debug('Add property filter {}={}'.format(k, v)) properties.append((k, v)) diff --git a/tests/cite/ogcapi-features/README.md b/tests/cite/ogcapi-features/README.md new file mode 100644 index 000000000..47a6e19af --- /dev/null +++ b/tests/cite/ogcapi-features/README.md @@ -0,0 +1,17 @@ +# CITE testing for OGC API - Features + +## Test data + +Test data used is a subset of the [Canadian National Water Data Archive](https://www.canada.ca/en/environment-climate-change/services/water-overview/quantity/monitoring/survey/data-products-services/national-archive-hydat.html) +as extracted from the [MSC Geomet OGC API](https://eccc-msc.github.io/open-data/msc-geomet/web-services_en/#ogc-api-features). + +## Running + +```bash +# install pygeoapi as per https://pygeoapi.io/#install-in-5-minutes +cd tests/cite/ogcapi-features +. cite.env +python ../../load_es_data.py ./canada-hydat-daily-mean-02hc003.json IDENTIFIER +pygeoapi generate-openapi-document -c $PYGEOAPI_CONFIG > $PYGEOAPI_OPENAPI +gunicorn pygeoapi.flask_app:APP -b 0.0.0.0:5001 --access-logfile '-' +``` diff --git a/tests/cite/ogcapi-features/canada-hydat-daily-mean-02HC003.json b/tests/cite/ogcapi-features/canada-hydat-daily-mean-02HC003.json new file mode 100644 index 000000000..202f7b198 --- /dev/null +++ b/tests/cite/ogcapi-features/canada-hydat-daily-mean-02HC003.json @@ -0,0 +1,1240 @@ +{ + "features": [ + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1975-10-03", + "properties": { + "DATE": "1975-10-03", + "FLOW": 2.039999961853028, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1975-10-03", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1975-10-02", + "properties": { + "DATE": "1975-10-02", + "FLOW": 2.059999942779541, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1975-10-02", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1975-10-01", + "properties": { + "DATE": "1975-10-01", + "FLOW": 2.140000104904175, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1975-10-01", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1975-10-07", + "properties": { + "DATE": "1975-10-07", + "FLOW": 1.940000057220459, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1975-10-07", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1975-10-06", + "properties": { + "DATE": "1975-10-06", + "FLOW": 1.9600000381469729, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1975-10-06", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1975-10-05", + "properties": { + "DATE": "1975-10-05", + "FLOW": 1.909999966621399, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1975-10-05", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1975-10-04", + "properties": { + "DATE": "1975-10-04", + "FLOW": 2.0, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1975-10-04", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1983-12-31", + "properties": { + "DATE": "1983-12-31", + "FLOW": 2.5999999046325684, + "FLOW_SYMBOL_EN": "Ice Conditions", + "FLOW_SYMBOL_FR": "Conditions \u00e0 glace", + "IDENTIFIER": "02HC003.1983-12-31", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1983-12-30", + "properties": { + "DATE": "1983-12-30", + "FLOW": 2.650000095367432, + "FLOW_SYMBOL_EN": "Ice Conditions", + "FLOW_SYMBOL_FR": "Conditions \u00e0 glace", + "IDENTIFIER": "02HC003.1983-12-30", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.2017-05-23", + "properties": { + "DATE": "2017-05-23", + "FLOW": 7.079999923706055, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.2017-05-23", + "LEVEL": 2.3320000171661377, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1955-09-09", + "properties": { + "DATE": "1955-09-09", + "FLOW": 1.4700000286102295, + "FLOW_SYMBOL_EN": "Estimated", + "FLOW_SYMBOL_FR": "Estim\u00e9", + "IDENTIFIER": "02HC003.1955-09-09", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1955-09-08", + "properties": { + "DATE": "1955-09-08", + "FLOW": 1.4700000286102295, + "FLOW_SYMBOL_EN": "Estimated", + "FLOW_SYMBOL_FR": "Estim\u00e9", + "IDENTIFIER": "02HC003.1955-09-08", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1955-09-07", + "properties": { + "DATE": "1955-09-07", + "FLOW": 1.4700000286102295, + "FLOW_SYMBOL_EN": "Estimated", + "FLOW_SYMBOL_FR": "Estim\u00e9", + "IDENTIFIER": "02HC003.1955-09-07", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1955-09-06", + "properties": { + "DATE": "1955-09-06", + "FLOW": 1.4700000286102295, + "FLOW_SYMBOL_EN": "Estimated", + "FLOW_SYMBOL_FR": "Estim\u00e9", + "IDENTIFIER": "02HC003.1955-09-06", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1955-09-05", + "properties": { + "DATE": "1955-09-05", + "FLOW": 1.4700000286102295, + "FLOW_SYMBOL_EN": "Estimated", + "FLOW_SYMBOL_FR": "Estim\u00e9", + "IDENTIFIER": "02HC003.1955-09-05", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1955-09-04", + "properties": { + "DATE": "1955-09-04", + "FLOW": 1.4700000286102295, + "FLOW_SYMBOL_EN": "Estimated", + "FLOW_SYMBOL_FR": "Estim\u00e9", + "IDENTIFIER": "02HC003.1955-09-04", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1955-09-03", + "properties": { + "DATE": "1955-09-03", + "FLOW": 1.4700000286102295, + "FLOW_SYMBOL_EN": "Estimated", + "FLOW_SYMBOL_FR": "Estim\u00e9", + "IDENTIFIER": "02HC003.1955-09-03", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1955-09-02", + "properties": { + "DATE": "1955-09-02", + "FLOW": 1.4700000286102295, + "FLOW_SYMBOL_EN": "Estimated", + "FLOW_SYMBOL_FR": "Estim\u00e9", + "IDENTIFIER": "02HC003.1955-09-02", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1955-09-01", + "properties": { + "DATE": "1955-09-01", + "FLOW": 1.4700000286102295, + "FLOW_SYMBOL_EN": "Estimated", + "FLOW_SYMBOL_FR": "Estim\u00e9", + "IDENTIFIER": "02HC003.1955-09-01", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1979-11-22", + "properties": { + "DATE": "1979-11-22", + "FLOW": 5.230000019073486, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1979-11-22", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1979-11-23", + "properties": { + "DATE": "1979-11-23", + "FLOW": 9.260000228881836, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1979-11-23", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1979-11-20", + "properties": { + "DATE": "1979-11-20", + "FLOW": 3.390000104904175, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1979-11-20", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1979-11-21", + "properties": { + "DATE": "1979-11-21", + "FLOW": 3.3299999237060547, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1979-11-21", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1979-11-26", + "properties": { + "DATE": "1979-11-26", + "FLOW": 25.799999237060547, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1979-11-26", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1979-11-27", + "properties": { + "DATE": "1979-11-27", + "FLOW": 24.399999618530277, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1979-11-27", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1979-11-24", + "properties": { + "DATE": "1979-11-24", + "FLOW": 20.5, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1979-11-24", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1979-11-25", + "properties": { + "DATE": "1979-11-25", + "FLOW": 17.899999618530273, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1979-11-25", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1979-11-28", + "properties": { + "DATE": "1979-11-28", + "FLOW": 18.600000381469727, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1979-11-28", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1979-11-29", + "properties": { + "DATE": "1979-11-29", + "FLOW": 17.5, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1979-11-29", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1967-02-09", + "properties": { + "DATE": "1967-02-09", + "FLOW": 4.53000020980835, + "FLOW_SYMBOL_EN": "Ice Conditions", + "FLOW_SYMBOL_FR": "Conditions \u00e0 glace", + "IDENTIFIER": "02HC003.1967-02-09", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1967-02-08", + "properties": { + "DATE": "1967-02-08", + "FLOW": 5.659999847412109, + "FLOW_SYMBOL_EN": "Ice Conditions", + "FLOW_SYMBOL_FR": "Conditions \u00e0 glace", + "IDENTIFIER": "02HC003.1967-02-08", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1967-02-01", + "properties": { + "DATE": "1967-02-01", + "FLOW": 3.259999990463257, + "FLOW_SYMBOL_EN": "Ice Conditions", + "FLOW_SYMBOL_FR": "Conditions \u00e0 glace", + "IDENTIFIER": "02HC003.1967-02-01", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1967-02-03", + "properties": { + "DATE": "1967-02-03", + "FLOW": 3.109999895095825, + "FLOW_SYMBOL_EN": "Ice Conditions", + "FLOW_SYMBOL_FR": "Conditions \u00e0 glace", + "IDENTIFIER": "02HC003.1967-02-03", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1967-02-02", + "properties": { + "DATE": "1967-02-02", + "FLOW": 2.8299999237060547, + "FLOW_SYMBOL_EN": "Ice Conditions", + "FLOW_SYMBOL_FR": "Conditions \u00e0 glace", + "IDENTIFIER": "02HC003.1967-02-02", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1967-02-05", + "properties": { + "DATE": "1967-02-05", + "FLOW": 3.9600000381469727, + "FLOW_SYMBOL_EN": "Ice Conditions", + "FLOW_SYMBOL_FR": "Conditions \u00e0 glace", + "IDENTIFIER": "02HC003.1967-02-05", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1967-02-04", + "properties": { + "DATE": "1967-02-04", + "FLOW": 3.400000095367432, + "FLOW_SYMBOL_EN": "Ice Conditions", + "FLOW_SYMBOL_FR": "Conditions \u00e0 glace", + "IDENTIFIER": "02HC003.1967-02-04", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1967-02-07", + "properties": { + "DATE": "1967-02-07", + "FLOW": 6.369999885559082, + "FLOW_SYMBOL_EN": "Ice Conditions", + "FLOW_SYMBOL_FR": "Conditions \u00e0 glace", + "IDENTIFIER": "02HC003.1967-02-07", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1967-02-06", + "properties": { + "DATE": "1967-02-06", + "FLOW": 4.53000020980835, + "FLOW_SYMBOL_EN": "Ice Conditions", + "FLOW_SYMBOL_FR": "Conditions \u00e0 glace", + "IDENTIFIER": "02HC003.1967-02-06", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1995-01-29", + "properties": { + "DATE": "1995-01-29", + "FLOW": 3.309999942779541, + "FLOW_SYMBOL_EN": "Ice Conditions", + "FLOW_SYMBOL_FR": "Conditions \u00e0 glace", + "IDENTIFIER": "02HC003.1995-01-29", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1987-03-13", + "properties": { + "DATE": "1987-03-13", + "FLOW": 9.720000267028809, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1987-03-13", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.2017-05-27", + "properties": { + "DATE": "2017-05-27", + "FLOW": 17.299999237060547, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.2017-05-27", + "LEVEL": 2.5420000553131104, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1987-03-12", + "properties": { + "DATE": "1987-03-12", + "FLOW": 12.600000381469728, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1987-03-12", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1987-03-11", + "properties": { + "DATE": "1987-03-11", + "FLOW": 16.200000762939453, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1987-03-11", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1987-03-10", + "properties": { + "DATE": "1987-03-10", + "FLOW": 29.100000381469727, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1987-03-10", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1987-03-17", + "properties": { + "DATE": "1987-03-17", + "FLOW": 7.440000057220459, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1987-03-17", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1987-03-16", + "properties": { + "DATE": "1987-03-16", + "FLOW": 6.989999771118164, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1987-03-16", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.2017-05-26", + "properties": { + "DATE": "2017-05-26", + "FLOW": 30.399999618530277, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.2017-05-26", + "LEVEL": 2.691999912261963, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1987-03-15", + "properties": { + "DATE": "1987-03-15", + "FLOW": 7.210000038146973, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1987-03-15", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.1983-11-17", + "properties": { + "DATE": "1983-11-17", + "FLOW": 13.0, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.1983-11-17", + "LEVEL": null, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + -79.52039337158203, + 43.69894027709961 + ], + "type": "Point" + }, + "id": "02HC003.2014-07-07", + "properties": { + "DATE": "2014-07-07", + "FLOW": 6.110000133514404, + "FLOW_SYMBOL_EN": null, + "FLOW_SYMBOL_FR": null, + "IDENTIFIER": "02HC003.2014-07-07", + "LEVEL": 2.2950000762939453, + "LEVEL_SYMBOL_EN": null, + "LEVEL_SYMBOL_FR": null, + "PROV_TERR_STATE_LOC": "ON", + "STATION_NAME": "HUMBER RIVER AT WESTON", + "STATION_NUMBER": "02HC003" + }, + "type": "Feature" + } + ], + "links": [ + { + "href": "https://geo.weather.gc.ca/geomet/features/collections/hydrometric-daily-mean/items?f=json", + "rel": "self", + "title": "This document as GeoJSON", + "type": "application/geo+json" + }, + { + "href": "https://geo.weather.gc.ca/geomet/features/collections/hydrometric-daily-mean/items?f=html", + "rel": "alternate", + "title": "This document as HTML", + "type": "text/html" + }, + { + "href": "https://geo.weather.gc.ca/geomet/features/collections/hydrometric-daily-mean/items/?startindex=0", + "rel": "prev", + "title": "items (prev)", + "type": "application/geo+json" + }, + { + "href": "https://geo.weather.gc.ca/geomet/features/collections/hydrometric-daily-mean/items/?startindex=500", + "rel": "next", + "title": "items (next)", + "type": "application/geo+json" + }, + { + "href": "https://geo.weather.gc.ca/geomet/features/collections/hydrometric-daily-mean", + "rel": "collection", + "title": "Daily Mean of Water Level or Flow", + "type": "application/json" + } + ], + "numberMatched": 26516, + "numberReturned": 50, + "timeStamp": "2019-12-23T14:08:36.974150Z", + "type": "FeatureCollection" +} diff --git a/tests/cite/ogcapi-features/cite.config.yml b/tests/cite/ogcapi-features/cite.config.yml new file mode 100644 index 000000000..326922216 --- /dev/null +++ b/tests/cite/ogcapi-features/cite.config.yml @@ -0,0 +1,99 @@ +server: + bind: + host: 0.0.0.0 + port: 5001 + url: http://localhost:5001 + mimetype: application/json; charset=UTF-8 + encoding: utf-8 + language: en-US + cors: true + pretty_print: true + limit: 10 + # templates: /path/to/templates + map: + url: https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png + attribution: 'Wikimedia maps | Map data © OpenStreetMap contributors' + +logging: + level: ERROR + #logfile: /tmp/pygeoapi.log + +metadata: + identification: + title: pygeoapi CITE instance + description: pygeoapi instance in support of OGC CITE compliance + keywords: + - geospatial + - data + - api + keywords_type: theme + terms_of_service: null + url: https://pygeoapi.io + license: + name: CC-BY 4.0 license + url: https://creativecommons.org/licenses/by/4.0/ + provider: + name: pygeoapi + url: https://pygeoapi.io + contact: + name: Tom Kralidis + position: Senior Systems Scientist + address: Mailing Address + city: City + stateorprovince: Administrative Area + postalcode: Zip or Postal Code + country: Country + phone: +xx-xxx-xxx-xxxx + fax: +xx-xxx-xxx-xxxx + email: pygeoapi@lists.osgeo.org + url: https://pygeoapi.io/community/ + hours: Mo-Fr 08:00-17:00 + instructions: During hours of service. Off on weekends. + role: pointOfContact + +datasets: + canada-hydat-daily-mean-02hc003: + title: Daily Mean of Water Level or Flow + description: The daily mean is the average of all unit values for a given day. + keywords: [Daily, Daily Mean, Water Level, Flow, Discharge] + crs: + - CRS84 + links: + - type: text/html + rel: canonical + title: Water Level and Flow - Environment Canada + href: https://wateroffice.ec.gc.ca + hreflang: en-CA + - type: text/html + rel: canonical + title: Niveau d'eau et débit - Environnement Canada + href: https://wateroffice.ec.gc.ca/index_f.html + hreflang: fr-CA + - type: text/html + rel: download + title: "National water data archive: HYDAT - Canada.ca" + href: https://www.canada.ca/en/environment-climate-change/services/water-overview/quantity/monitoring/survey/data-products-services/national-archive-hydat.html + hreflang: en-CA + - type: text/html + rel: download + title: "Archives nationales des données hydrologiques : HYDAT - Canada.ca" + href: https://www.canada.ca/fr/environnement-changement-climatique/services/eau-apercu/volume/surveillance/releves/produits-donnees-services/archives-nationales-hydat.html + hreflang: fr-CA + - type: application/zip + rel: download + title: download data + href: https://collaboration.cmc.ec.gc.ca/cmc/hydrometrics/www + hreflang: en-CA + extents: + spatial: + bbox: [-142, 52, -52, 84] + crs: http://www.opengis.net/def/crs/OGC/1.3/CRS84 + temporal: + begin: 1850-01-01 + end: null # or empty + + provider: + name: Elasticsearch + data: http://localhost:9200/canada-hydat-daily-mean-02hc003/FeatureCollection + id_field: IDENTIFIER + time_field: DATE diff --git a/tests/cite/ogcapi-features/cite.env b/tests/cite/ogcapi-features/cite.env new file mode 100644 index 000000000..70b33865a --- /dev/null +++ b/tests/cite/ogcapi-features/cite.env @@ -0,0 +1,2 @@ +export PYGEOAPI_CONFIG=`pwd`/cite.config.yml +export PYGEOAPI_OPENAPI=`pwd`/cite.openapi.yml