update config, add conformance

This commit is contained in:
Tom Kralidis
2018-03-21 09:18:59 -04:00
parent 2cd3621ddd
commit 43b44574f5
4 changed files with 31 additions and 10 deletions
+9 -6
View File
@@ -15,14 +15,16 @@ logging:
metadata:
identification:
title: pygeoapi
abstract: pygeoapi provides an API to geospatial data
description: pygeoapi provides an API to geospatial data
keywords:
- geospatial
- data
- api
keywords_type: theme
fees: None
accessconstraints: None
terms_of_service: None
license:
name: CC-BY 4.0 license
url: https://creativecommons.org/licenses/by/4.0/
provider:
name: Organization Name
url: https://github.com/geopython/pygeoapi
@@ -48,7 +50,7 @@ datasets:
provider: CSV
id_field: id
title: Observations
abstract: Observations
description: Observations
keywords:
- observations
- monitoring
@@ -66,12 +68,13 @@ datasets:
begin: 2000-10-30T18:24:39Z
end: 2007-10-30T08:57:29Z
data: tests/data/obs.csv
landsat-aws:
type: Polygon
provider: Elasticsearch
id_field: id_
title: my dataset
abstract: my dataset
description: my dataset
keywords:
- kw1
- kw2
@@ -94,7 +97,7 @@ datasets:
provider: GeoJSON
id_field: null # null indicates use feature enumeration
title: Large Lakes
abstract: lakes of the world, public domain
description: lakes of the world, public domain
keywords:
- lakes
crs:
+1 -1
View File
@@ -57,7 +57,7 @@ def serve(ctx, host, port, debug=False):
hostport = '{}:{}'.format(host_, port_)
api = app.add_api(settings['swagger'], debug=debug, strict_validation=True,
arguments={'host': hostport})
arguments={'host': hostport, 'config': settings})
settings['api'] = api.specification
+2 -2
View File
@@ -17,7 +17,7 @@
<body>
<header>
<h1><a title="{{ config['metadata']['identification']['title'] }}" href="{{ config['server']['url'] }}">{{ config['metadata']['identification']['title'] }}</a></h1>
<span itemprop="description">{{ config['metadata']['identification']['abstract'] }}</span>
<span itemprop="description">{{ config['metadata']['identification']['description'] }}</span>
</header>
<section id="service-metadata">
<h2>Service Metadata</h2>
@@ -37,4 +37,4 @@
<hr/>
<footer>Powered by <a title="pygeoapi" href="https://github.com/geopython/pygeoapi">pygeoapi</a> {{ version }}</footer>
</body>
</html>
</html>
+19 -1
View File
@@ -39,6 +39,24 @@ from pygeoapi.provider import load_provider
LOGGER = logging.getLogger(__name__)
def api_conformance(f='json'):
"""
Provide conformance definition
:param f: response format (default JSON)
:returns: dict of conformance
"""
return {
'conformsTo': [
'http://www.opengis.net/spec/wfs-1/3.0/req/core',
'http://www.opengis.net/spec/wfs-1/3.0/req/oas30',
'http://www.opengis.net/spec/wfs-1/3.0/req/html',
'http://www.opengis.net/spec/wfs-1/3.0/req/geojson'
]
}
def describe_collections(f='json'):
"""
Provide feature collection metadata
@@ -92,7 +110,7 @@ def describe_collections(f='json'):
collection = {'links': [], 'crs': []}
collection['name'] = k
collection['title'] = v['title']
collection['description'] = v['abstract']
collection['description'] = v['description']
for crs in v['crs']:
collection['crs'].append(
'http://www.opengis.net/def/crs/OGC/1.3/{}'.format(crs))