diff --git a/app/routes/collections_page.py b/app/routes/collections_page.py index 70037a5..ba3a6fa 100644 --- a/app/routes/collections_page.py +++ b/app/routes/collections_page.py @@ -105,7 +105,7 @@ def create_collection(collection_id: str = "", instance_id: str = "") -> dict: # Get posision in default instance position=edr_pydantic.data_queries.EDRQuery( link=edr_pydantic.data_queries.EDRQueryLink( - href=f"{collection_url}position/", + href=f"{collection_url}position", rel="data", variables=edr_pydantic.variables.Variables( query_type="position", diff --git a/app/routes/position_page.py b/app/routes/position_page.py index eb5a21d..a023c5b 100644 --- a/app/routes/position_page.py +++ b/app/routes/position_page.py @@ -216,13 +216,17 @@ def check_coords_within_bounds(ds: xr.Dataset, point: Point) -> Tuple[bool, str] return True, "" -@router.get("/collections/isobaric/position") -async def create_isobaric_page(coords: str) -> dict: +@router.get("/collections/isobaric/position/") +async def create_isobaric_page(request: Request, coords: str = "") -> dict: """Position. This is the main function of this API. Needs a string with the coordinates, and will return data for the nearest point. """ + if len(coords) == 0: + return { + "body": f'Error: No coordinates provided. Example: {str(request.base_url)[0:-1]}{request.scope["path"]}?coords=POINT(11 59)' + } return create_point(coords=coords)