An OGC API EDR implementation using SQL for pygeoapi
Project description
pygeoapi Environmental Data Retrieval
This repository contains SQL pygeoapi providers for OGC API - Environmental Data Retrieval (EDR).
OGC API - EDR
The configuration for SQL OGC API - EDR follows that of pygeoapi for OGC API - Features, with the addition of two sections edr_fields and external_tables.
For more detailed documentation on the creation of a pygeoapi configuration file, refer
to the docs.
Config Explanation
- The
tablefield represents the top level table that all joins are relative to - The
edr_fieldssection defines the columns of your SQL table and their corresponding field in OGC API - EDR.- Fields are defined in the format
TABLE.COLUMN
- Fields are defined in the format
- The
external_tablessection allows foriegn table joins to allowedr_fieldsto refer to any table/column with a mapped relationship to the primary table.foreignis the column in the primary table defined in thetablefieldremoteis the column in the foreign table defined in theexternal_tables- Example: The config below describes a schema with a table named
locations. Its has a keyobservation_id_in_locations_tablewhich is a reference and we can join this to the primary tableobservationsusing theobservation_idcolumn.
external_tables: locations: remote: observation_id_in_locations_table foreign: observation_idIn many cases, theforeignandremotefields will be the same if you want to join the same key name from the primary table to the foreign table. (i.e. if you have aobservation_idfield in the primary table andobservation_idfield in the table for locations that associates the two)- Example: The config below describes a schema with a table named
Postgres
The configuration for Postgres EDR is as follows:
- type: edr
name: pgedr.PostgresEDRProvider
data: # Same as PostgresSQLProvider
host: ${POSTGRES_HOST}
dbname: ${POSTGRES_DB}
user: ${POSTGRES_USER}
password: ${POSTGRES_PASSWORD}
# the schema in which the relevant tables are located
search_path: [capture]
table: waterservices_daily
edr_fields: # Required EDR Fields
id_field: id # Result identifier field
geom_field: geometry # Result geometry field
time_field: time # Result time field
location_field: monitoring_location_id # Result location identifier field
result_field: value # Result value/timeseries field
parameter_id: parameter_code # Result parameter id field
parameter_name: waterservices_timeseries_metadata.parameter_name # Result parameter name field
parameter_unit: unit_of_measure # Result parameter unit field
external_tables: # Additional table joins
waterservices_timeseries_metadata: # JOIN waterservices_timeseries_metadata ON waterservices_daily.parameter_code=waterservices_timeseries_metadata.parameter_code
foreign: parameter_code
remote: parameter_code
MySQL
The configuration for MySQL EDR is as follows:
- type: edr
name: pgedr.MySQLEDRProvider
data: # Same as MySQLProvider
host: ${MYSQL_HOST}
port: ${MYSQL_PORT}
dbname: ${MYSQL_DATABASE}
user: ${MYSQL_USER}
password: ${MYSQL_PASSWORD}
search_path: [${MYSQL_DATABASE}]
table: landing_observations
edr_fields: # Required EDR Fields
id_field: id
geom_field: airports.airport_locations.geometry_wkt
time_field: time
location_field: location_id
result_field: value
parameter_id: parameter_id
parameter_name: airport_parameters.name
parameter_unit: airport_parameters.units
external_tables: # Additional table joins
airports: # JOIN airports ON landing_observations.location_id=airports.code
foreign: location_id
remote: code
airports.airport_locations: # JOIN airport_locations ON airports.code=airport_locations.id
foreign: code
remote: id
airport_parameters: # JOIN airport_parameters ON landing_observations.parameter_id=airport_parameters.id
foreign: parameter_id
remote: id
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pgedr-0.2.dev0.tar.gz.
File metadata
- Download URL: pgedr-0.2.dev0.tar.gz
- Upload date:
- Size: 19.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
934f6897b0383f136881adc75ac876326679bc129ae3c70a3ba3848968a534b0
|
|
| MD5 |
6778fa0d372854c01c492e86a1dfee92
|
|
| BLAKE2b-256 |
4ab6c24740a349cc7b562e63f3a0af73836be6a72d59b1d1f5d66e4bb803f652
|
Provenance
The following attestation bundles were made for pgedr-0.2.dev0.tar.gz:
Publisher:
pypi.yml on internetofwater/pgedr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pgedr-0.2.dev0.tar.gz -
Subject digest:
934f6897b0383f136881adc75ac876326679bc129ae3c70a3ba3848968a534b0 - Sigstore transparency entry: 1066569519
- Sigstore integration time:
-
Permalink:
internetofwater/pgedr@41d269779636f6c4b4be1ca709ba2e955bfeb8b2 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/internetofwater
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@41d269779636f6c4b4be1ca709ba2e955bfeb8b2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pgedr-0.2.dev0-py3-none-any.whl.
File metadata
- Download URL: pgedr-0.2.dev0-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a570c81756800d8f2bf3f01a6880d8675236dd69b76dd6427eac3976df59d92
|
|
| MD5 |
9992274c6d7e7c6efd91fff961e755d0
|
|
| BLAKE2b-256 |
901c2ea55bbed50b24a45211d510a330c0bd425bc4aabd56da6da2adc93afd92
|
Provenance
The following attestation bundles were made for pgedr-0.2.dev0-py3-none-any.whl:
Publisher:
pypi.yml on internetofwater/pgedr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pgedr-0.2.dev0-py3-none-any.whl -
Subject digest:
5a570c81756800d8f2bf3f01a6880d8675236dd69b76dd6427eac3976df59d92 - Sigstore transparency entry: 1066569521
- Sigstore integration time:
-
Permalink:
internetofwater/pgedr@41d269779636f6c4b4be1ca709ba2e955bfeb8b2 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/internetofwater
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@41d269779636f6c4b4be1ca709ba2e955bfeb8b2 -
Trigger Event:
release
-
Statement type: