Skip to content

Commit

Permalink
Update landing page info
Browse files Browse the repository at this point in the history
  • Loading branch information
Teddy-1000 committed Oct 10, 2024
1 parent 02709b1 commit 3c443f7
Showing 1 changed file with 42 additions and 9 deletions.
51 changes: 42 additions & 9 deletions api/metadata_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
from grpc_getter import get_ts_ag_request

import datastore_pb2 as dstore
from utilities import get_unique_values_for_metadata, seconds_to_iso_8601_duration, convert_cm_to_m
from utilities import (
get_unique_values_for_metadata,
seconds_to_iso_8601_duration,
convert_cm_to_m,
)

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
Expand Down Expand Up @@ -56,14 +60,32 @@ def datetime_to_iso_string(value: datetime) -> str:

def get_landing_page(request):
return LandingPageModel(
title="E-SOH EDR API",
description="The E-SOH EDR API",
keywords=["weather", "temperature", "wind", "humidity", "pressure", "clouds", "radiation"],
title="Observations Europe EUMETNET",
description="EDR data service for European environmental observations from EUMETNET",
keywords=[
"weather",
"temperature",
"wind",
"humidity",
"pressure",
"clouds",
"radiation",
],
provider=Provider(name="RODEO", url="https://rodeo-project.eu/"),
contact=Contact(email="[email protected]"),
links=[
Link(href=f"{request.url}", rel="self", title="Landing Page in JSON", type="application/json"),
Link(href=f"{request.url}docs", rel="service-doc", title="API description in HTML", type="text/html"),
Link(
href=f"{request.url}",
rel="self",
title="Landing Page in JSON",
type="application/json",
),
Link(
href=f"{request.url}docs",
rel="service-doc",
title="API description in HTML",
type="text/html",
),
Link(
href=f"{request.url}openapi.json",
rel="service-desc",
Expand All @@ -76,7 +98,11 @@ def get_landing_page(request):
title="Conformance Declaration in JSON",
type="application/json",
),
Link(href=f"{request.url}collections", rel="data", title="Collections metadata in JSON"),
Link(
href=f"{request.url}collections",
rel="data",
title="Collections metadata in JSON",
),
],
)

Expand Down Expand Up @@ -120,7 +146,7 @@ async def get_collection_metadata(base_url: str, is_self) -> Collection:
description=f"{ts.standard_name} at {level}m, aggregated over {period} with method '{ts.function}'",
observedProperty=ObservedProperty(
id=f"https://vocab.nerc.ac.uk/standard_name/{ts.standard_name}",
label=ts.parameter_name,
label=ts.standard_name,
),
measurementType=MeasurementType(
method=ts.function,
Expand Down Expand Up @@ -154,7 +180,14 @@ async def get_collection_metadata(base_url: str, is_self) -> Collection:
],
extent=Extent(
spatial=Spatial(
bbox=[[spatial_extent.left, spatial_extent.bottom, spatial_extent.right, spatial_extent.top]],
bbox=[
[
spatial_extent.left,
spatial_extent.bottom,
spatial_extent.right,
spatial_extent.top,
]
],
crs="EPSG:4326",
),
temporal=Temporal(
Expand Down

0 comments on commit 3c443f7

Please sign in to comment.