Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed workshop/content/docs/assets/images/edr-plugin3.png
Binary file not shown.
Binary file removed workshop/content/docs/assets/images/edr-plugin4.png
Binary file not shown.
Binary file removed workshop/content/docs/assets/images/edr-plugin5.png
Binary file not shown.
Binary file removed workshop/content/docs/assets/images/edr-plugin6.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 28 additions & 44 deletions workshop/content/docs/publishing/ogcapi-edr.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,50 +25,54 @@ and coverage provider plugins.

## Publish environmental data in pygeoapi

Let's try publishing some ICOADS data via the EDR xarray plugin. The sample ICOADS data can be found in `workshop/exercises/data/coads_sst.nc`:
Let's try publishing sample [weather forecast model data](https://www.ncei.noaa.gov/products/weather-climate-models/global-forecast) from NOAA via the EDR xarray plugin. The sample data can be found in `workshop/exercises/data/gfs_tmp2m.zarr`:


!!! question "Update the pygeoapi configuration"

Open the pygeoapi configuration file in a text editor. Add a new dataset section as follows:

``` {.yaml linenums="1"}
icoads-sst:
noaa-gfs:
type: collection
title: International Comprehensive Ocean-Atmosphere Data Set (ICOADS)
description: International Comprehensive Ocean-Atmosphere Data Set (ICOADS)
title: Global Forecast System (GFS), 2 metre air temperature
description: Global Forecast System (GFS), 2 metre air temperature
keywords:
- icoads
- sst
- gfs
- forecast
- air temperature
extents:
spatial:
bbox: [-180,-90,180,90]
bbox: [-128,23,-65,50]
crs: http://www.opengis.net/def/crs/OGC/1.3/CRS84
temporal:
begin: 2000-01-16T06:00:00Z
end: 2000-12-16T06:00:00Z
begin: 2023-09-27T18:00:00Z
end: 2023-09-28T06:00:00Z
links:
- type: text/html
rel: canonical
title: information
href: https://psl.noaa.gov/data/gridded/data.coads.1deg.html
href: https://www.ncei.noaa.gov/products/weather-climate-models/global-forecast
hreflang: en-US
providers:
- type: edr
name: xarray-edr
data: /data/coads_sst.nc
data: /data/gfs_tmp2m.zarr
x_field: lon
y_field: lat
time_field: time
format:
name: NetCDF
mimetype: application/x-netcdf
name: zarr
mimetype: application/zip
```

Save the configuration and restart Docker Compose. Navigate to <http://localhost:5000/collections> to evaluate whether the new dataset has been published.

At first glance, the `icoads-sst` collection appears as a normal OGC API - Coverages collection. Look a bit closer at the collection description, and notice
that there is a `parameter_names` key that describes EDR parameter names for the collection queries.
At first glance, the Global Forecast System (GFS), 2 metre air temperature (`noaa-gfs`) collection appears as a normal OGC API collection. Look a bit closer at the collection description (<http://localhost:5000/collection/noaa-gfs>), and notice the "Data Queries" and "Parameters" sections (add `f=json` to the collection description URL to inspect the additional EDR specific elements such as `data_queries` and `parameter_names` various JSON elements). The "Parameters" section describes the environmental parameters associated with the collection which can be used as part of a collection query.

Try visualizing the following EDR position query in a web browser: <http://localhost:5000/collections/icoads-sst/position?coords=POINT(174.7645%20-36.8509)>
Try visualizing the following EDR position query (focused on Fort Lauderdale, USA) in a web browser: <http://localhost:5000/collections/noaa-gfs/position?coords=POINT(-80.1373%2026.1224)>. Note the interactive graph displaying the time series of 2 metre temperature data.

![](../assets/images/edr-position-query-html.png){ width=100% }

## Client access

Expand All @@ -82,26 +86,6 @@ You can access the plugin through an entry on the plugin menu.

![](../assets/images/edr-plugin2.png){ width=100% }

The first thing to setup is the server url. Use the url of the Landing Page here: `http://localhost:5000/`

!!! tip "You should also start by defining the folder where you would like the data fetched by the plugin to be downloaded"

![](../assets/images/edr-plugin3.png){ width=100% }

The combo box will be populated with all the collections available on that server. Select the EDR collection: `International Comprehensive Ocean-Atmosphere Data Set (ICOADS)`.

!!! tip "You may safely ignore the warnings displayed here"

![](../assets/images/edr-plugin4.png){ width=100% }

The data query combo box will be populated with the data query types available for this collection; in this case: position and cube. You may select the cube query and then click the button to set the spatial extent of that query. A new dialog will open, displaying multiple options to define the spatial extent. You may choose the `Draw on canvas`, to draw a rectangle in the map view extent.

![](../assets/images/edr-plugin5.png){ width=100% }

You can close this dialog and run the query. The plugin will fetch all the data available that fits into this query and display it as a layer group.

![](../assets/images/edr-plugin6.png){ width=100% }

### OWSLib - Advanced

[OWSLib](https://owslib.readthedocs.io) is a Python library to interact with OGC Web Services and supports a number of OGC APIs including OGC API - Environmental Data Retrieval.
Expand Down Expand Up @@ -135,10 +119,10 @@ You can close this dialog and run the query. The plugin will fetch all the data
>>> collections = w.collections()
>>> len(collections['collections'])
13
>>> icoads_sst = w.collection('icoads-sst')
>>> icoads_sst['parameter_names'].keys()
dict_keys(['SST', 'AIRT', 'UWND', 'VWND'])
>>> data = w.query_data('icoads-sst', 'position', coords='POINT(174.7645 -36.8509)', parameter_names=['SST', 'AIRT'])
>>> noaa_gfs = w.collection('noaa-gfs')
>>> noaa_gfs['parameter_names'].keys()
dict_keys(['t2m'])
>>> data = w.query_data('noaa-gfs', 'position', coords='POINT(-80.1373 26.1224)', parameter_names=['t2m'])
>>> data # CoverageJSON data
```

Expand All @@ -153,10 +137,10 @@ You can close this dialog and run the query. The plugin will fetch all the data
>>> collections = w.collections()
>>> len(collections['collections'])
13
>>> icoads_sst = w.collection('icoads-sst')
>>> icoads_sst['parameter_names'].keys()
dict_keys(['SST', 'AIRT', 'UWND', 'VWND'])
>>> data = w.query_data('icoads-sst', 'position', coords='POINT(174.7645 -36.8509)', parameter_names=['SST', 'AIRT'])
>>> noaa_gfs= w.collection('noaa-gfs')
>>> noaa_gfs['parameter_names'].keys()
dict_keys(['t2m'])
>>> data = w.query_data('noaa-gfs', 'position', coords='POINT(-80.1373 26.1224)', parameter_names=['t2m'])
>>> data # CoverageJSON data
```

Expand Down
26 changes: 13 additions & 13 deletions workshop/exercises/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,59 +26,59 @@ This directory provides sample data to demonstrate functionality.
- copyright: Comune di Firenze
- license: CC BY 4.0

### ICOADS
- title: [coads_sst.nc](coads_sst.nc)
- description: The International Comprehensive Ocean-Atmosphere Data Set (ICOADS) offers surface marine data spanning the past three centuries, and simple gridded monthly summary products for 2° latitude x 2° longitude boxes back to 1800 (and 1x1 boxes since 1960)° these data and products are freely distributed worldwide. As it contains observations from many different observing systems encompassing the evolution of measurement technology over hundreds of years, ICOADS is probably the most complete and heterogeneous collection of surface marine data in existence.
- copyright: NOAA Physical Sciences Library
- license: ICOADS data provided by the NOAA/OAR/ESRL PSL, Boulder, Colorado, USA, from their Web site at https://psl.noaa.gov.

### NOAA GFS
- title: [gfs_tmp2m.zarr](./gfs_tmp2m.zarr)
- description: The Global Forecast System (GFS) is a National Centers for Environmental Prediction (NCEP) weather forecast model that generates data for dozens of atmospheric and land-soil variables, including temperatures, winds, precipitation, soil moisture, and atmospheric ozone concentration. The system couples four separate models (atmosphere, ocean model, land/soil model, and sea ice) that work together to accurately depict weather conditions.
- url: https://www.ncei.noaa.gov/products/weather-climate-models/global-forecast
- copyright: National Oceanic and Atmospheric Administration
- license: GFS data provided by the NOAA/NCEI, https://www.ncei.noaa.gov

## Metadata/Records

### Free Wifi Hotspots in Florence
- title: [./firenze/metadata/xml/free-wifi-florence.xml](./firenze/metadata/xml/free-wifi-florence.xml)
- title: [firenze/metadata/xml/free-wifi-florence.xml](./firenze/metadata/xml/free-wifi-florence.xml)
- url: https://opendata.comune.fi.it/?q=metarepo/datasetinfo&id=fb5b7bac-bcb0-4326-9388-7e3f3d671d71
- description: The dataset shows the location of the places in the Municipality of Florence where a free wireless internet connection service (Wifi) is available.
- copyright: Comune di Firenze
- license: CC BY 4.0

### Carsharing spots in Florence
- title: [./firenze/metadata/xml/carsharing-florence.xml](./firenze/metadata/xml/carsharing-florence.xml)
- title: [firenze/metadata/xml/carsharing-florence.xml](./firenze/metadata/xml/carsharing-florence.xml)
- url: http://dati.cittametropolitana.fi.it/geonetwork/srv/ita/catalog.search#/metadata/cmfi:9c92966b-ae6b-42d4-9729-592b016e4b82
- description: Punctual positioning of the car-sharing activities of the Metropolitan City of Florence.
- copyright: Comune di Firenze
- license: CC BY 4.0

### German Soil Types
- title: [./bodenart.en.csv](./bodenart.en.csv)
- title: [bodenart.en.csv](./bodenart.en.csv)
- url: https://registry.gdi-de.org/codelist/de.bund.thuenen/bodenart/bodenart.en.csv
- description: Bodenarten auf Basis der Bodenkundlichen Kartieranleitung 5. Auflage (KA5)
- copyright: Johann Heinrich von Thünen-Institut
- license: CC BY 4.0

### Estonia Dams
- title: [./tartu/metadata/xml/estonia-dams.xml](./tartu/metadata/xml/estonia-dams.xml)
- title: [tartu/metadata/xml/estonia-dams.xml](./tartu/metadata/xml/estonia-dams.xml)
- url: https://metadata.geoportaal.ee/geonetwork/srv/eng/catalog.search#/metadata/937c4456-fd9f-40cf-89ba-30be47146858
- description: Eesti paisude ruumiandmekogum koondab andmeid paisude asukohtade, tehniliste parameetrite ja seisundi kohta. Andmeid hallatakse Eesti Looduse Infosüsteemis (EELIS).
- copyright: Keskkonnaagentuur
- license: CC BY-SA 3.0

### Estonia Landcover
- title: [./tartu/metadata/xml/estonia-landcover.xml](./tartu/metadata/xml/estonia-landcover.xml)
- title: [tartu/metadata/xml/estonia-landcover.xml](./tartu/metadata/xml/estonia-landcover.xml)
- url: https://metadata.geoportaal.ee/geonetwork/srv/eng/catalog.search#/metadata/2cde09a2-ea86-4a73-9768-6c7ba78bc0e6
- description: Eesti maakatte andmebaas. Koostatud ühtse üle-euroopalise Corine Land Cover metoodika alusel. Minimaalne kaardistusühik 25 ha, hierarhiline nomenklatuur IV taset.
- copyright: Keskkonnaagentuur
- license: CC BY-SA 3.0

### Estonia Transport
- title: [./tartu/metadata/xml/estonia-transport.xml](./tartu/metadata/xml/estonia-transport.xml)
- title: [tartu/metadata/xml/estonia-transport.xml](./tartu/metadata/xml/estonia-transport.xml)
- url: https://metadata.geoportaal.ee/geonetwork/srv/eng/catalog.search#/metadata/bf38a8fc-96f1-4d34-9130-18160e489514
- description: Ruumiandmekogum "Eesti topograafia andmekogu - transport" hõlmab Eesti topograafia andmekogu (ETAK) reaalsusmudeli transpordi gruppi koondatud reaalse maailma nähtuseid, mis on klassifitseeritud nähtusklassideks
- copyright: Keskkonnaagentuur
- license: CC BY-SA 3.0

### NASA Blue Marble Night Lights Data sample over Estonia
- title: [./tartu/estonia_light.tif](./tartu/estonia_light.tif)
- title: [tartu/estonia_light.tif](./tartu/estonia_light.tif)
- url: https://blackmarble.gsfc.nasa.gov/
- description: At night, satellite images of Earth capture a uniquely human signal--artificial lighting. Remotely-sensed lights at night provide a new data source for improving our understanding of interactions between human systems and the environment. NASA has developed the Black Marble, a daily calibrated, corrected, and validated product suite, so nightlight data can be used effectively for scientific observations. Black Marble is playing a vital role in research on light pollution, illegal fishing, fires, disaster impacts and recovery, and human settlements and associated energy infrastructures.
- copyright: NASA
Expand Down
Binary file removed workshop/exercises/data/coads_sst.nc
Binary file not shown.
1 change: 1 addition & 0 deletions workshop/exercises/data/gfs_tmp2m.zarr/.zattrs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions workshop/exercises/data/gfs_tmp2m.zarr/.zgroup
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"zarr_format": 2
}
1 change: 1 addition & 0 deletions workshop/exercises/data/gfs_tmp2m.zarr/.zmetadata
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"metadata": {".zgroup": {"zarr_format": 2}, ".zattrs": {}, "heightAboveGround/.zattrs": {"long_name": "height above the surface", "units": "m", "positive": "up", "standard_name": "height", "_ARRAY_DIMENSIONS": []}, "heightAboveGround/.zarray": {"shape": [], "chunks": [], "dtype": "<f8", "fill_value": "NaN", "order": "C", "filters": null, "dimension_separator": ".", "compressor": {"id": "blosc", "cname": "lz4", "clevel": 5, "shuffle": 1, "blocksize": 0}, "zarr_format": 2}, "lat/.zattrs": {"units": "degrees_north", "standard_name": "latitude", "long_name": "latitude", "stored_direction": "decreasing", "_ARRAY_DIMENSIONS": ["lat"]}, "lat/.zarray": {"shape": [55], "chunks": [55], "dtype": "<f8", "fill_value": "NaN", "order": "C", "filters": null, "dimension_separator": ".", "compressor": {"id": "blosc", "cname": "lz4", "clevel": 5, "shuffle": 1, "blocksize": 0}, "zarr_format": 2}, "lon/.zattrs": {"units": "degrees_east", "long_name": "longitude", "_ARRAY_DIMENSIONS": ["lon"]}, "lon/.zarray": {"shape": [127], "chunks": [127], "dtype": "<f8", "fill_value": "NaN", "order": "C", "filters": null, "dimension_separator": ".", "compressor": {"id": "blosc", "cname": "lz4", "clevel": 5, "shuffle": 1, "blocksize": 0}, "zarr_format": 2}, "step/.zattrs": {"long_name": "time since forecast_reference_time", "standard_name": "forecast_period", "dtype": "timedelta64[ns]", "units": "hours", "_ARRAY_DIMENSIONS": ["time"]}, "step/.zarray": {"shape": [5], "chunks": [5], "dtype": "<f8", "fill_value": "NaN", "order": "C", "filters": null, "dimension_separator": ".", "compressor": {"id": "blosc", "cname": "lz4", "clevel": 5, "shuffle": 1, "blocksize": 0}, "zarr_format": 2}, "t2m/.zattrs": {"units": "degC", "long_name": "2 m air temperature", "model": "GFS", "resolution": "0.5 degree", "cycle": "2023092718Z", "coordinates": "heightAboveGround step valid_time", "_ARRAY_DIMENSIONS": ["time", "lat", "lon"]}, "t2m/.zarray": {"shape": [5, 55, 127], "chunks": [5, 55, 127], "dtype": "<f4", "fill_value": "NaN", "order": "C", "filters": null, "dimension_separator": ".", "compressor": {"id": "blosc", "cname": "zstd", "clevel": 9, "shuffle": 1, "blocksize": 0}, "zarr_format": 2}, "time/.zattrs": {"units": "hours since 2023-09-27 18:00:00", "calendar": "proleptic_gregorian", "_ARRAY_DIMENSIONS": ["time"]}, "time/.zarray": {"shape": [5], "chunks": [5], "dtype": "<i8", "fill_value": null, "order": "C", "filters": null, "dimension_separator": ".", "compressor": {"id": "blosc", "cname": "lz4", "clevel": 5, "shuffle": 1, "blocksize": 0}, "zarr_format": 2}, "valid_time/.zattrs": {"standard_name": "time", "long_name": "time", "units": "seconds since 1970-01-01T00:00:00", "calendar": "proleptic_gregorian", "_ARRAY_DIMENSIONS": ["time"]}, "valid_time/.zarray": {"shape": [5], "chunks": [5], "dtype": "<f8", "fill_value": "NaN", "order": "C", "filters": null, "dimension_separator": ".", "compressor": {"id": "blosc", "cname": "lz4", "clevel": 5, "shuffle": 1, "blocksize": 0}, "zarr_format": 2}}, "zarr_consolidated_format": 1}
17 changes: 17 additions & 0 deletions workshop/exercises/data/gfs_tmp2m.zarr/heightAboveGround/.zarray
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"shape": [],
"chunks": [],
"dtype": "<f8",
"fill_value": "NaN",
"order": "C",
"filters": null,
"dimension_separator": ".",
"compressor": {
"id": "blosc",
"cname": "lz4",
"clevel": 5,
"shuffle": 1,
"blocksize": 0
},
"zarr_format": 2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"long_name": "height above the surface",
"units": "m",
"positive": "up",
"standard_name": "height",
"_ARRAY_DIMENSIONS": []
}
Binary file not shown.
21 changes: 21 additions & 0 deletions workshop/exercises/data/gfs_tmp2m.zarr/lat/.zarray
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"shape": [
55
],
"chunks": [
55
],
"dtype": "<f8",
"fill_value": "NaN",
"order": "C",
"filters": null,
"dimension_separator": ".",
"compressor": {
"id": "blosc",
"cname": "lz4",
"clevel": 5,
"shuffle": 1,
"blocksize": 0
},
"zarr_format": 2
}
9 changes: 9 additions & 0 deletions workshop/exercises/data/gfs_tmp2m.zarr/lat/.zattrs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"units": "degrees_north",
"standard_name": "latitude",
"long_name": "latitude",
"stored_direction": "decreasing",
"_ARRAY_DIMENSIONS": [
"lat"
]
}
Binary file added workshop/exercises/data/gfs_tmp2m.zarr/lat/0
Binary file not shown.
21 changes: 21 additions & 0 deletions workshop/exercises/data/gfs_tmp2m.zarr/lon/.zarray
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"shape": [
127
],
"chunks": [
127
],
"dtype": "<f8",
"fill_value": "NaN",
"order": "C",
"filters": null,
"dimension_separator": ".",
"compressor": {
"id": "blosc",
"cname": "lz4",
"clevel": 5,
"shuffle": 1,
"blocksize": 0
},
"zarr_format": 2
}
7 changes: 7 additions & 0 deletions workshop/exercises/data/gfs_tmp2m.zarr/lon/.zattrs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"units": "degrees_east",
"long_name": "longitude",
"_ARRAY_DIMENSIONS": [
"lon"
]
}
Binary file added workshop/exercises/data/gfs_tmp2m.zarr/lon/0
Binary file not shown.
21 changes: 21 additions & 0 deletions workshop/exercises/data/gfs_tmp2m.zarr/step/.zarray
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"shape": [
5
],
"chunks": [
5
],
"dtype": "<f8",
"fill_value": "NaN",
"order": "C",
"filters": null,
"dimension_separator": ".",
"compressor": {
"id": "blosc",
"cname": "lz4",
"clevel": 5,
"shuffle": 1,
"blocksize": 0
},
"zarr_format": 2
}
9 changes: 9 additions & 0 deletions workshop/exercises/data/gfs_tmp2m.zarr/step/.zattrs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"long_name": "time since forecast_reference_time",
"standard_name": "forecast_period",
"dtype": "timedelta64[ns]",
"units": "hours",
"_ARRAY_DIMENSIONS": [
"time"
]
}
Binary file added workshop/exercises/data/gfs_tmp2m.zarr/step/0
Binary file not shown.
25 changes: 25 additions & 0 deletions workshop/exercises/data/gfs_tmp2m.zarr/t2m/.zarray
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"shape": [
5,
55,
127
],
"chunks": [
5,
55,
127
],
"dtype": "<f4",
"fill_value": "NaN",
"order": "C",
"filters": null,
"dimension_separator": ".",
"compressor": {
"id": "blosc",
"cname": "zstd",
"clevel": 9,
"shuffle": 1,
"blocksize": 0
},
"zarr_format": 2
}
13 changes: 13 additions & 0 deletions workshop/exercises/data/gfs_tmp2m.zarr/t2m/.zattrs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"units": "degC",
"long_name": "2 m air temperature",
"model": "GFS",
"resolution": "0.5 degree",
"cycle": "2023092718Z",
"coordinates": "heightAboveGround step valid_time",
"_ARRAY_DIMENSIONS": [
"time",
"lat",
"lon"
]
}
Binary file added workshop/exercises/data/gfs_tmp2m.zarr/t2m/0.0.0
Binary file not shown.
Loading
Loading