Pygeoapi server installation with PostGIS database for laji.fi occurrence data.
To install and run the Pygeoapi instance locally, follow these steps:
git clone https://github.com/luomus/laji-pygeoapi.git
cd laji-pygeoapi
POSTGRES_DB=my_geospatial_db
POSTGRES_USER=postgres
POSTGRES_PASSWORD=admin123
POSTGRES_HOST=postgres
PAGES=latest
BRANCH=dev
MULTIPROCESSING=False
RUNNING_IN_OPENSHIFT=False
LAJI_API_URL=https://apitest.laji.fi/v0/
ACCESS_TOKEN=loremipsum12456789
Where
Variable name | Definition | Default value |
---|---|---|
POSTGRES_DB | The database name | my_geospatial_db |
POSTGRES_USER | The database user | postgres |
POSTGRES_PASSWORD | The password associated with the default user | not set |
POSTGRES_HOST | The host running the database | postgres |
PAGES | Integer to download a specific number of pages. "0" to empty the database. "all" to add all data (this takes a lot of time), "latest" to add only the latest data after the last update | latest |
BRANCH | The GitHub branch | dev |
MULTIPROCESSING | Enables ("True") or disables ("False") multiprocessing when downloading data from the source APIs | False |
RUNNING_IN_OPENSHIFT | "True" when Pygeoapi is running in an OpenShift / Kubernetes environment. "False" when locally in a Docker. | False |
ACCESS_TOKEN | API Access token needed for using the source APIs. See instruction: https://api.laji.fi/explorer/ | loremipsum12456789 |
docker compose up --build
- That's it! Your Pygeoapi instance with the PostGIS database should now be up and running.
Once the Docker container is up and running, you can access the Pygeoapi service through your web browser. By default, the service is available at http://localhost:5000.
The configuration file for Pygeoapi is named pygeoapi-config.yml
. You can modify these files in a text editor to customize the behavior of the Pygeoapi service or connect to a different PostGIS database tables.
To edit the data or database, see Python files in the src
folder.
See https://github.com/luomus/laji-pygeoapi/blob/dev/openshift/README.md