Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct README based on feedback of issue #1374 #1380

Merged
merged 4 commits into from
Oct 31, 2023
Merged
Changes from 3 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
50 changes: 35 additions & 15 deletions docker/examples/sensorthings/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,51 @@
# Pygeoapi with SensorThings (STA)
# Setting up a Pygeoapi Server with SensorThings (STA) Using Docker Compose
shivathapaa marked this conversation as resolved.
Show resolved Hide resolved

This folder contains a Docker Compose configuration necessary to setup an example
`pygeoapi` server using a STA endpoint.
This folder contains a Docker Compose configuration necessary to setup an example `pygeoapi` server using a STA endpoint.

This config is only for local development and testing.

## Introduction

The `pygeoapi` server with SensorThings (STA) provides a platform for publishing SensorThings API data as features. [SensorThings](https://github.com/opengeospatial/sensorthings) is a standardized way to provide access to Internet of Things (IoT) data, making it easier to manage and interact with sensor data.

## SensorThings Build options

There are three example STA endpoints. To switch between examples, the `pygeoapi.config.yml` file used in the docker
compose needs to be changed.
There are two example SensorThings API (STA) endpoints available. To switch between examples, you need to change the `pygeoapi.config.yml` file used in the [Docker Compose file](docker-compose.yml).

1. [**brgm.config.yml**](brgm.config.yml): Configures a `pygeoapi` server to serve water quality data from BRGM (Bureau de Recherches Géologiques et Minières), the French Geological Survey.

2. [**usgs.config.yml**](usgs.config.yml): Configures a `pygeoapi` server to serve data from the United States Geological Survey (USGS).


### Additional details
- [**docker-compose.yml**](docker-compose.yml): Defines the Docker Compose configuration for orchestrating the `pygeoapi` server examples. It specifies the Docker image to use, the ports to expose, and the volumes to mount.

- The BRGM water quality endpoint provides access to water quality data from BRGM, the French Geological Survey.

- The first, [brgm.sta.pygeoapi.config.yml](brgm.sta.pygeoapi.config.yml) creates a `pygeoapi` server serving the BRGM water quality endpoint.
- The USGS data endpoint provides access to data from the United States Geological Survey (USGS).

- The second, [iow.sta.pygeoapi.config.yml](iow.sta.pygeoapi.config.yml) creates a `pygeoapi` server hosting example IoW endpoint with URIs.
### Which build option should I choose?

- The final config, [sta.pygeoapi.config.yml](sta.pygeoapi.config.yml) creates a `pygeoapi` server inside of a muti-container Docker app,
and linked to an empty [FROST server](https://fraunhoferiosb.github.io/FROST-Server/). To use this configuration,
uncomment Lines 40 - 70 of the docker-compose.yml file in addition to changing the pygeoapi config. The
database can be populated following a workflow similar to that of the populator script for build testing, `load_sta_data.py`.
`Note: The pygeoapi server will fail to build until the STA server has been populated, thus the addition of always restart`
The best build option for you will depend on your specific needs. If you are interested in accessing water quality data from the BRGM, then you should choose the `brgm.config.yml` file. If you are interested in accessing data from the USGS, then you should choose the `usgs.config.yml` file.

If you are not sure which build option to choose, you can start with the `brgm.config.yml` file. This is the simplest build option and it provides access to a _real-world dataset_.

## SensorThings Usage

After editing the [docker-compose.yml](docker-compose.yml) file appropriately:
After editing the [docker-compose.yml](docker-compose.yml) file appropriately, you can start the `pygeoapi` container using the following command:

```
```bash
docker compose up [-d]
```

Navigate to `localhost:5000`.
This command will create and start the pygeoapi container, republishing SensorThings data. You can then access the pygeoapi server at http://localhost:5000.

## Stopping and Removing Containers

To stop and remove the containers, use the following command:

```bash
docker compose down
```

Please ensure you have the necessary requirements installed before following the setup instructions.