Skip to content

Commit 2a6800e

Browse files
committed
Update default j2 dataset template
1 parent ef02f01 commit 2a6800e

File tree

2 files changed

+159
-109
lines changed

2 files changed

+159
-109
lines changed

api/routers/feature.py

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424

2525
router = APIRouter(prefix="/collections/observations")
2626

27-
env = Environment(loader=FileSystemLoader(os.getenv("JINJA2_TEMPLATES", "templates")), autoescape=select_autoescape())
27+
env = Environment(
28+
loader=FileSystemLoader(os.getenv("JINJA2_TEMPLATES", "templates")),
29+
autoescape=select_autoescape(),
30+
)
2831

2932

3033
@router.get(
@@ -61,21 +64,32 @@ async def search_timeseries(
6164
] = None,
6265
institution: Annotated[
6366
str | None,
64-
Query(description="Institution that published the data", openapi_examples=openapi_examples.institution),
67+
Query(
68+
description="Institution that published the data",
69+
openapi_examples=openapi_examples.institution,
70+
),
6571
] = None,
6672
platform: Annotated[
6773
str | None,
68-
Query(description="Platform ID, WIGOS or WIGOS equivalent.", openapi_examples=openapi_examples.wigos_id),
74+
Query(
75+
description="Platform ID, WIGOS or WIGOS equivalent.",
76+
openapi_examples=openapi_examples.wigos_id,
77+
),
6978
] = None,
7079
standard_name: Annotated[
7180
str | None,
7281
Query(
73-
alias="standard-name", description="CF 1.9 standard name", openapi_examples=openapi_examples.standard_name
82+
alias="standard-name",
83+
description="CF 1.9 standard name",
84+
openapi_examples=openapi_examples.standard_name,
7485
),
7586
] = None,
7687
unit: Annotated[
7788
str | None,
78-
Query(description="Unit of observed physical property", openapi_examples=openapi_examples.unit),
89+
Query(
90+
description="Unit of observed physical property",
91+
openapi_examples=openapi_examples.unit,
92+
),
7993
] = None,
8094
instrument: Annotated[str | None, Query(description="Instrument Id")] = None,
8195
level: Annotated[
@@ -87,12 +101,16 @@ async def search_timeseries(
87101
] = None,
88102
period: Annotated[
89103
str | None,
90-
Query(description="Duration of collection period in ISO8601", openapi_examples=openapi_examples.period),
104+
Query(
105+
description="Duration of collection period in ISO8601",
106+
openapi_examples=openapi_examples.period,
107+
),
91108
] = None,
92109
method: Annotated[
93110
str | None,
94111
Query(
95-
description="Aggregation method used to sample observed property", openapi_examples=openapi_examples.method
112+
description="Aggregation method used to sample observed property",
113+
openapi_examples=openapi_examples.method,
96114
),
97115
] = None,
98116
f: Annotated[
@@ -150,7 +168,8 @@ async def get_time_series_by_id(
150168
] = formatters.Metadata_Formats.geojson,
151169
):
152170
obs_request = dstore.GetObsRequest(
153-
filter=dict(timeseries_id=dstore.Strings(values=[item_id])), temporal_latest=True
171+
filter=dict(timeseries_id=dstore.Strings(values=[item_id])),
172+
temporal_latest=True,
154173
)
155174
time_series = await get_obs_request(obs_request)
156175

@@ -177,7 +196,7 @@ async def get_dataset_metadata(request: Request):
177196
"temporal_extents": [
178197
[
179198
f"{extent.temporal_extent.start.ToDatetime().strftime('%Y-%m-%dT%H:%M:%SZ')}",
180-
f"{extent.temporal_extent.end.ToDatetime().strftime('%Y-%m-%dT%H:%M:%SZ')}",
199+
"..",
181200
],
182201
],
183202
"url_base": base_url,
Lines changed: 131 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"id": "urn:wmo:md:eu-eumetnet-observations:swob-realtime",
2+
"id": "urn:wmo:md:eu-eumetnet-surface-observations:land-station-observations",
33
"conformsTo": [
4-
"http://wis.wmo.int/spec/wcmp/2/conf/core"
5-
],
6-
"type": "Feature",
4+
"http://wis.wmo.int/spec/wcmp/2/conf/core"
5+
],
6+
"type": "Feature",
77
"geometry": {
88
"type": "Polygon",
99
"coordinates": {{ spatial_extents }}
@@ -12,105 +12,136 @@
1212
"interval": {{ temporal_extents|tojson }},
1313
"resolution": "PT10M"
1414
},
15-
"properties": {
16-
"title": "Land surface weather observations",
17-
"description": "Land surface observations measured at automatic and manual stations of EUMETNET Members (last 24 hours)",
18-
"themes": [
19-
{
20-
"concepts": [
21-
{
22-
"id": "weather"
23-
}
24-
],
25-
"scheme": "https://codes.wmo.int/wis/topic-hierarchy/earth-system-discipline"
26-
},
27-
{
28-
"concepts": [
29-
{
30-
"id": "surface-based-observations"
31-
}
32-
],
33-
"scheme": "https://codes.wmo.int/wis/topic-hierarchy/earth-system-discipline/_weather"
34-
}
15+
"properties": {
16+
"title": "Land surface weather observations",
17+
"description":"Land surface observations measured at automatic and manual weather stations of EUMETNET Members and thier trusted partners (last 24 hours only)",
18+
"contacts": [
19+
{
20+
"name": "Met Norway",
21+
"organization": "National Meteorological service of Norway, Met Norway",
22+
"phones": [
23+
{
24+
"value": "+4722963000"
25+
}
3526
],
36-
"language": "en",
37-
"type": "dataset",
38-
"created": "2023-01-01T00:00:00Z",
39-
"updated": "2024-09-19T00:00:00Z",
40-
"contacts": [
41-
{
42-
"organization": "EUMETNET",
43-
"addresses": [
44-
{
45-
"deliveryPoint": [
46-
"Avenue Circulaire 3"
47-
],
48-
"city": "Bruxelles",
49-
"postalCode": "1180",
50-
"country": "Belgique"
51-
}
52-
],
53-
"links": [
54-
{
55-
"href": "https://www.eumetnet.eu/about-us/",
56-
"rel": "about",
57-
"type": "text/html"
58-
}
59-
],
60-
"roles": [
61-
"host"
62-
]
63-
}
27+
"emails": [
28+
{
29+
"value": "post@met.no"
30+
}
6431
],
65-
"keywords": [
66-
"surface weather",
67-
"observations",
68-
"meteorology"
32+
"addresses": [
33+
{
34+
"deliveryPoint": [
35+
"https://www.met.no/en/contact-us"
36+
],
37+
"name": "Met Norway",
38+
"city": "Oslo",
39+
"postalCode": "0313",
40+
"country": "Norway"
41+
}
6942
],
70-
"wmo:dataPolicy": "core"
71-
},
72-
"links": [
73-
{
74-
"href": "E-SOH dataset mqtt stream",
75-
"rel": "items",
76-
"title": "E-SOH dataset data notifications",
77-
"type": "application/json"
78-
},
79-
{
80-
"href": "E-SOH time series mqtt stream",
81-
"rel": "items",
82-
"title": "E-SOH time series data notifications",
83-
"type": "application/json"
84-
},
85-
{
86-
"href": {{ url_base|tojson }},
87-
"rel": "data",
88-
"title": "E-SOH EDR API landing page",
89-
"type": "application/json"
90-
},
91-
{
92-
"href": {{ url_docs|tojson }},
93-
"rel": "related",
94-
"title": "E-SOH API documentation",
95-
"type": "application/json"
96-
},
97-
{
98-
"href": {{ url_conformance|tojson }},
99-
"rel": "conformance",
100-
"title": "E-SOH Conformance Declaration",
101-
"type": "application/json"
102-
},
103-
{
104-
"href": "https://www.eumetnet.eu/wp-content/uploads/2018/03/List-of-current-Members-as-pdf.pdf",
43+
"links": [
44+
{
10545
"rel": "about",
106-
"title": "EUMETNET Members",
107-
"type": "text/html"
46+
"type": "text/html",
47+
"href": "https://www.eumetnet.eu/about-us"
48+
}
49+
],
50+
"roles": ["host"]
51+
}
52+
],
53+
"keywords": [
54+
"weather",
55+
"surface-based observations",
56+
"observations",
57+
"meteorology",
58+
"surface weather",
59+
"Norway",
60+
"Finalnd",
61+
"the Netherlands"
62+
],
63+
"themes": [
64+
{ "concepts": [
65+
{
66+
"id":"weather",
67+
"title": "Weather",
68+
"url": "https://codes.wmo.int/wis/topic-hierarchy/earth-system-discipline/weather"
69+
}
70+
],
71+
"scheme":"https://codes.wmo.int/wis/topic-hierarchy/earth-system-discipline"
72+
},
73+
{ "concepts": [
74+
{
75+
"id":"surface-based-observations"
76+
}
77+
],
78+
"scheme":"https://codes.wmo.int/wis/topic-hierarchy/earth-system-discipline/weather/surface-based-observations"
10879
},
109-
{
110-
"href": "https://creativecommons.org/licenses/by/4.0/",
111-
"rel": "license",
112-
"title": "Creative Commons BY 4.0 licence",
113-
"type": "text/html"
114-
}
115-
]
80+
{
81+
"concepts": [
82+
{
83+
"id": "air_temperature",
84+
"title": "Air temperature",
85+
"url": "http://vocab.nerc.ac.uk/standard_name/air_temperature/"
86+
},
87+
{
88+
"id": "wind_speed",
89+
"title": "Wind Speed",
90+
"url": "http://vocab.nerc.ac.uk/standard_name/wind_speed/"
91+
},
92+
{
93+
"id": "wind_to_direction",
94+
"title": "Wind to diection",
95+
"url": "http://vocab.nerc.ac.uk/standard_name/wind_to_direction/"
96+
}
97+
],
98+
"scheme": "https://vocab.nerc.ac.uk/standard_name"
99+
}
100+
],
101+
"language":"en",
102+
"created": "2025-06-04T14:00:00Z",
103+
"updated": "2025-06-04T14:00:00Z",
104+
"rights": "Users are granted free and unrestricted access to this data, without charge and with no conditions on use. Users are requested to attribute the producer of this data. WMO Unified Data Policy (Resolution 1 (Cg-Ext 2021))",
105+
"licence": "CC BY 4.0 Creative Commons license",
106+
"type": "dataset",
107+
"wmo:dataPolicy": "recommended"
108+
},
109+
"links": [
110+
{
111+
"href": {{ url_base|tojson }},
112+
"rel": "data",
113+
"title": "E-SOH EDR API landing page",
114+
"type": "application/json"
115+
},
116+
{
117+
"href": {{ url_docs|tojson }},
118+
"rel": "related",
119+
"title": "E-SOH API documentation",
120+
"type": "application/json"
121+
},
122+
{
123+
"href": {{ url_conformance|tojson }},
124+
"rel": "conformance",
125+
"title": "E-SOH Conformance Declaration",
126+
"type": "application/json"
127+
},
128+
{
129+
"rel": "related",
130+
"href": "https://www.eumetnet.eu/observations/observations-data-sharing-2/",
131+
"type": "text/html",
132+
"title": "Documentation related to EUMETNET data sharing"
133+
},
134+
{
135+
"rel": "related",
136+
"href": "https://www.eumetnet.eu/about-us-2/members-partners/",
137+
"type": "text/html",
138+
"title": "List of EUMETNET Members"
139+
},
140+
{
141+
"rel": "license",
142+
"href": "https://creativecommons.org/licenses/by/4.0/",
143+
"title": "Creative Commons BY 4.0 licence",
144+
"type": "text/html"
145+
}
146+
]
116147
}

0 commit comments

Comments
 (0)