Merge pull request #1005 from tomkralidis/updates-2022-09-30
updates 2022 09 30
This commit is contained in:
@@ -254,6 +254,7 @@ by downstream applications.
|
||||
`local-outlier-factor-plugin`_,Manaaki Whenua – Landcare Research,processes for local outlier detection
|
||||
`ogc-edc`_,Euro Data Cube,coverage provider atop the EDC API
|
||||
`nldi_xstool`_,United States Geological Survey,Water data processing
|
||||
`pygeometa-plugin`_,pygeometa project,pygeometa as a service
|
||||
|
||||
|
||||
.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter-pypackage
|
||||
@@ -263,3 +264,4 @@ by downstream applications.
|
||||
.. _`ogc-edc`: https://github.com/eurodatacube/ogc-edc/tree/oapi/edc_ogc/pygeoapi
|
||||
.. _`nldi_xstool`: https://github.com/ACWI-SSWD/nldi_xstool
|
||||
.. _`pygeoapi-plugin-cookiecutter`: https://code.usgs.gov/wma/nhgf/pygeoapi-plugin-cookiecutter
|
||||
.. _`pygeometa-plugin`: https://geopython.github.io/pygeometa/pygeoapi-plugin
|
||||
|
||||
@@ -1271,6 +1271,8 @@ class API:
|
||||
|
||||
return headers, 200, content
|
||||
|
||||
headers['Content-Type'] = 'application/schema+json'
|
||||
|
||||
return headers, 200, to_json(queryables, self.pretty_print)
|
||||
|
||||
@gzip
|
||||
|
||||
@@ -140,9 +140,13 @@ def collection_items(request: HttpRequest, collection_id: str) -> HttpResponse:
|
||||
collection_id,
|
||||
)
|
||||
elif request.method == 'POST':
|
||||
response_ = _feed_response(
|
||||
request, 'manage_collection_item', request, 'create', collection_id
|
||||
)
|
||||
if request.content_type is not None:
|
||||
if request.content_type == 'application/geo+json':
|
||||
response_ = _feed_response(request, 'manage_collection_item',
|
||||
request, 'create', collection_id)
|
||||
else:
|
||||
response_ = _feed_response(request, 'post_collection_items',
|
||||
request, collection_id)
|
||||
|
||||
response = _to_django_response(*response_)
|
||||
|
||||
|
||||
@@ -195,12 +195,13 @@ def collection_items(collection_id, item_id=None):
|
||||
api_.get_collection_items(request, collection_id))
|
||||
elif request.method == 'POST': # filter or manage items
|
||||
if request.content_type is not None:
|
||||
return get_response(
|
||||
api_.manage_collection_item(request, 'create',
|
||||
collection_id))
|
||||
else:
|
||||
return get_response(
|
||||
api_.post_collection_items(request, collection_id))
|
||||
if request.content_type == 'application/geo+json':
|
||||
return get_response(
|
||||
api_.manage_collection_item(request, 'create',
|
||||
collection_id))
|
||||
else:
|
||||
return get_response(
|
||||
api_.post_collection_items(request, collection_id))
|
||||
|
||||
elif request.method == 'DELETE':
|
||||
return get_response(
|
||||
|
||||
@@ -233,13 +233,15 @@ async def collection_items(request: Request, collection_id=None, item_id=None):
|
||||
api_.get_collection_items(
|
||||
request, collection_id))
|
||||
elif request.method == 'POST': # filter or manage items
|
||||
if request.headers.get('content-type') is not None:
|
||||
return get_response(
|
||||
api_.manage_collection_item(request, 'create',
|
||||
collection_id))
|
||||
else:
|
||||
return get_response(
|
||||
api_.post_collection_items(request, collection_id))
|
||||
content_type = request.headers.get('content-type')
|
||||
if content_type is not None:
|
||||
if content_type == 'application/geo+json':
|
||||
return get_response(
|
||||
api_.manage_collection_item(request, 'create',
|
||||
collection_id))
|
||||
else:
|
||||
return get_response(
|
||||
api_.post_collection_items(request, collection_id))
|
||||
|
||||
elif request.method == 'DELETE':
|
||||
return get_response(
|
||||
|
||||
@@ -536,6 +536,7 @@ def test_get_collection_queryables(config, api_):
|
||||
|
||||
req = mock_request({'f': 'json'})
|
||||
rsp_headers, code, response = api_.get_collection_queryables(req, 'obs')
|
||||
assert rsp_headers['Content-Type'] == 'application/schema+json'
|
||||
queryables = json.loads(response)
|
||||
|
||||
assert 'properties' in queryables
|
||||
|
||||
Reference in New Issue
Block a user