From 7fb420c142fb0c715f85f81dfd18b0f31bd3b2c7 Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Thu, 1 Dec 2022 06:27:01 -0500 Subject: [PATCH] add OAMaps django support (#668) --- pygeoapi/django_/urls.py | 10 ++++++++++ pygeoapi/django_/views.py | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/pygeoapi/django_/urls.py b/pygeoapi/django_/urls.py index a37de2b..e88d0b4 100644 --- a/pygeoapi/django_/urls.py +++ b/pygeoapi/django_/urls.py @@ -97,6 +97,16 @@ urlpatterns = [ views.collection_coverage_rangetype, name='collection-coverage-rangetype', ), + path( + 'collections//map', + views.collection_map, + name='collection-map', + ), + path( + 'collections//styles//tiles/', views.collection_tiles, diff --git a/pygeoapi/django_/views.py b/pygeoapi/django_/views.py index 2540878..f4038e4 100644 --- a/pygeoapi/django_/views.py +++ b/pygeoapi/django_/views.py @@ -153,6 +153,41 @@ def collection_items(request: HttpRequest, collection_id: str) -> HttpResponse: return response +def collection_map(request: HttpRequest, collection_id: str): + """ + OGC API - Maps map render endpoint + + :param collection_id: collection identifier + + :returns: HTTP response + """ + + response_ = _feed_response(request, 'get_collection_map', collection_id) + + response = _to_django_response(*response_) + + return response + + +def collection_style_map(request: HttpRequest, collection_id: str, + style_id: str = None): + """ + OGC API - Maps map render endpoint + + :param collection_id: collection identifier + :param collection_id: style identifier + + :returns: HTTP response + """ + + response_ = _feed_response(request, 'get_collection_map', + collection_id, style_id) + + response = _to_django_response(*response_) + + return response + + def collection_item(request: HttpRequest, collection_id: str, item_id: str) -> HttpResponse: """