diff --git a/pygeoapi/starlette_app.py b/pygeoapi/starlette_app.py index af8798a..b1979f5 100644 --- a/pygeoapi/starlette_app.py +++ b/pygeoapi/starlette_app.py @@ -511,12 +511,13 @@ async def get_job_result_resource(request: Request, api_.get_job_result_resource, request, job_id, resource) -async def get_collection_edr_query(request: Request, collection_id=None, instance_id=None): # noqa +async def get_collection_edr_query(request: Request, collection_id=None, instance_id=None, location_id=None): # noqa """ OGC EDR API endpoints :param collection_id: collection identifier :param instance_id: instance identifier + :param location_id: location id of a /locations/ query :returns: HTTP response """ @@ -527,10 +528,15 @@ async def get_collection_edr_query(request: Request, collection_id=None, instanc if 'instance_id' in request.path_params: instance_id = request.path_params['instance_id'] - query_type = request["path"].split('/')[-1] # noqa + if 'location_id' in request.path_params: + location_id = request.path_params['location_id'] + query_type = 'locations' + else: + query_type = request['path'].split('/')[-1] + return await execute_from_starlette( edr_api.get_collection_edr_query, request, collection_id, - instance_id, query_type, + instance_id, query_type, location_id, skip_valid_check=True, )