openapi-sdi

A Spatial Data Infrastructure based on OGC Open API specifications

https://github.com/emotional-cities/openapi-sdi

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.0%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

A Spatial Data Infrastructure based on OGC Open API specifications

Basic Info
  • Host: GitHub
  • Owner: emotional-cities
  • License: mit
  • Language: Scheme
  • Default Branch: master
  • Size: 82.2 MB
Statistics
  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • Open Issues: 6
  • Releases: 3
Created almost 4 years ago · Last pushed 8 months ago
Metadata Files
Readme License Citation

README.md

eMOTIONAL Cities SDI

DOI

This document describes how to setup and run the Spatial Data Infrastructure (SDI) from the eMOTIONAL Cities project. If you are in rush, you can jump to the next section.

These docker-compositions are loosely based on the compositions from the pygeoapi project. They enable building and running a stack of FOSS & FOSS4G/OSGeo software, which implements an SDI using the latest OGC API standards. This infrastructure is mostly focused on sharing vector data, and its related metadata.

Regardess of the docker-composition you choose to run, you will launch a system which includes pygeoapi using an Elasticsearch backend for storing both, data and metadata.

In addition, we have leveraged other tools from the ELK: logstash to transform and insert metadata and kibana to visualize the content of the elasticsearch indexes.

Quick Setup

You will need docker and docker-compose installed in your system, in order to run this infrastructure. If you don't have them already, you can use the provided convenience script to install them:

./install_docker.sh

Start pygeoapi

The simplest way to start the SDI is by using the docker-compose-pull.yml composition:

docker-compose -f docker-compose-pull.yml up -d

This will pull and run all the relevant docker images. If you encounter any issues, please read the Troubleshooting section. If you have a more advanced use case, please continue reading.

The docker-compose-pull.yml composition pulls the images from docker hub. In some cases, you may need to do some changes which require rebuilding the images (e.g.: you want to use a different dataset). In those cases, you may use docker-compose-local.yml:

docker-compose -f docker-compose-local.yml build

And then:

docker-compose -f docker-compose-local.yml up -d

After building images locally with docker-compose-local.yml, you can push them to docker hub:

docker tag openapi-sdi_elastic_search emotionalcities/openapi-sdi_elastic_search docker tag openapi-sdi_metadata_logstash emotionalcities/openapi-sdi_metadata_logstash docker tag openapi-sdi_geopackage_pusher emotionalcities/openapi-sdi_geopackage_pusher docker tag openapi-sdi_postgis emotionalcities/sdi-template-postgis docker push emotionalcities/openapi-sdi_elastic_search docker push emotionalcities/openapi-sdi_metadata_logstash docker push emotionalcities/openapi-sdi_geopackage_pusher docker push emotionalcities/sdi-template-postgis

The docker-compose.yml is designed for production and it includes a web server. Launch it with:

docker-compose up -d

You can read more about docker-compose on this link

Regardless the composition you choosen, when all goes well, pygeoapi will be available at port 80 of the host: http://localhost.

Environment Variables

This compositions read secrets from an environment file on this folder: .env.

Create this file with the following format, replacing "SOMEPASSWORD" by reasonable values.

POSTGRES_PASSWORD="SOMEPASSWORD" POSTGRES_DB="SOMEPASSWORD" POSTGRES_USER="SOMEPASSWORD" FROST_USER="SOMEUSERNAME" FROST_PASSWORD="SOMEPASSWORD"

Elasticsearch ingests Geojson files stored in remote S3 bucket. To access the S3 bucket it's necessary to create a file inside ES directory, named credentials with following content:

[default] aws_access_key_id=YOURSECRET_WITHOUTQUOTES aws_secret_access_key=YOURSECRET_WITHOUTQUOTES aws_region=eu-central-1

ES/credentials is loaded in the image, so it must exists during build time. So, every time you change it, please remember to run:

docker-compose -f docker-compose-local.yml build

With .env file it's not necessary, because it's injected during docker compose up.

Troubleshooting

Elasticsearch requires the host system to have its virtual memory parameter (maxmapcount) here set as follows:

sudo sysctl -w vm.max_map_count=262144

If the docker composition fails with the following error: docker_elastic_search_1 exited with code 78

it is very likely that you need to setup the sysctl.

SensorThings API Server

This server is the FROST implementation of the OGC Sensor Things API Standard.

Quick Setup

You will need docker and docker-compose installed in your system, in order to run this infrastructure.

First create a .env file with the environment variables. For example (replace the values for sensible values):

POSTGRES_PASSWORD="nenwwnew" POSTGRES_DB="ddmdwlmwe" POSTGRES_USER="dmwledmw" STA_USER="dqkmqdwlmwwmwl" STA_PASSWORD=dddddddddddd FROST_USER=dd FROST_PASSWORD=edl,el,eed

Change script permission:

sudo chmod +x sensorthings.sh

Then run:

docker-compose up -d

Access the server on: http://localhost/FROST-Server/

Add Data

The frost endpoint is protected with basic authentication. Replace user with your user, defined in the .env file with FROST_USER and mypassword with the defined FROST_PASSWORD.

We recommend using a client like the frost-sta-client

Consume Data

You can view/analyse data using any sensorthings API compliant client, for instance the SensorThingsAPI QGIS plugin (see screenshots bellow).

screenshot of the SensorThingsAPI QGIS plugin

screenshot of the SensorThingsAPI QGIS plugin

License

This project is released under an MIT License

License: MIT

Owner

  • Name: emotional-cities
  • Login: emotional-cities
  • Kind: organization

eMOTIONAL Cities H2020 Project

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: openapi-sdi
message: eMOTIONAL Cities Spatial Data Infrastructure
type: software
authors:
  - given-names: Antonio
    family-names: Cerciello
    email: ant@byteroad.net
    orcid: 'https://orcid.org/0009-0002-4417-1461'
    affiliation: Byteroad
  - given-names: Joana
    family-names: Simoes
    email: jo@byteroad.net
    orcid: 'https://orcid.org/0000-0002-7180-3367'
    affiliation: Byteroad
identifiers:
  - type: doi
    value: 10.5281/zenodo.13758189
    description: Version v3.0.0
repository-code: 'https://github.com/emotional-cities/openapi-sdi'
url: 'https://emotional.byteroad.net/'
keywords:
  - pygeoapi
  - SDI
  - OGC API
  - Spatial Data Infrastructure
license: MIT
commit: f5e409d250c041f92b106741a15a001311b88d7a
version: v3.0.0
date-released: '2023-09-13'

GitHub Events

Total
  • Issues event: 1
  • Watch event: 1
  • Issue comment event: 4
  • Push event: 11
  • Create event: 1
Last Year
  • Issues event: 1
  • Watch event: 1
  • Issue comment event: 4
  • Push event: 11
  • Create event: 1