REST and OGC API for WOUDC data services
WOUDC API provides a RESTful API for that provides discovery and access to ozone and ultraviolet radiation data in support of the World Ozone and Ultraviolet Radiation Data Centre (WOUDC), one of six World Data Centres as part of the Global Atmosphere Watch programme of the WMO.
- Python 3.10 and above
- virtualenv
- Elasticsearch (8 and above)
- pygeoapi (0.19.0 and above)
- woudc-extcsv (0.6.0 and above)
Dependencies are listed in requirements.txt. Dependencies are automatically installed during installation.
# setup virtualenv
python3 -m venv --system-site-packages woudc-api_env
cd woudc-api_env
source bin/activate
# setup local OGC schemas (i.e. WOUDC_API_OGC_SCHEMAS_LOCATION in default.env)
mkdir schemas.opengis.net
curl -O http://schemas.opengis.net/SCHEMAS_OPENGIS_NET.zip && unzip ./SCHEMAS_OPENGIS_NET.zip "ogcapi/*" -d schemas.opengis.net && rm -f ./SCHEMAS_OPENGIS_NET.zip
# optional for development: clone pygeoapi codebase and install
git clone https://github.com/geopython/pygeoapi.git
cd pygeoapi
pip3 install -r requirements.txt
python3 setup.py install
cd ..
# clone woudc-extcsv and install
git clone https://github.com/woudc/woudc-extcsv.git
cd woudc-extcsv
python3 setup.py install
cd ..
# clone woudc-api codebase and install
git clone https://github.com/woudc/woudc-api.git
cd woudc-api
python3 setup.py install
# set system environment variables
cp default.env local.env
vi local.env # edit accordingly
. local.env
# generate openapi document
pygeoapi openapi generate ${PYGEOAPI_CONFIG} -f json --output-file ${PYGEOAPI_OPENAPI}
# optional: validate openapi document
pygeoapi openapi validate ${PYGEOAPI_OPENAPI}
# run the server
woudc-api serve # server runs on http://localhost:5000
curl http://localhost:5000 # redirect to WOUDC data services pages
curl http://localhost:5000/oapi # OGC API endpoint
Docker commands:
# set system environment variables
cp default.env local.env
vi local.env # edit accordingly
. local.env
# build
docker build -t woudc-api .
# run container
docker run -d --name woudc-api -p ${WOUDC_API_BIND_PORT}:${WOUDC_API_BIND_PORT} woudc-api
Docker compose commands (recommended):
# set system environment variables
cp default.env docker.env
vi docker.env # edit accordingly
. docker.env
# build image
docker compose -f docker-compose.yml build
# container down
docker compose -f docker-compose.yml down
# container up (detached)
docker compose -f docker-compose.yml up -d
# install dev requirements
pip install -r requirements-dev.txt
All bugs, enhancements and issues are managed on GitHub.