update config, add conformance
This commit is contained in:
+9
-6
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user