This is a modified instance of the pygeoapi that can act as a server to host various urban models. It extends the functionalities of the pygeopai with a Websocket implementation. Different microservices/processes can connect with the pygeoapi via Websockets. The processes are then dynamically stored in the Urban Model Server instance and can be executed under the specific /processes/<process-id>/execution
endpoint. A job ID is created as usual and once the calculations are finished, the results are transferred back from the Microservices and stored under the /jobs/<job-id>/results
endpoint.
It is thus possible to connect multiple processing microservices with the Urban Model Server as long as the SOCKETAPP
CORS settings allow for it. The microservices can be written in different programming languages and Dockerized environments with their respective packages. Dependency conflicts can thus be resolved.
The architecture of the Urban Model Server looks as following:
To start the pygeoapi in local development mode, follow these steps
- Create a virtual environment in Python with
python3 -m venv urbanmodelserver
- Navigate to the new environment with
cd urbanmodelserver
and activate it with. bin/activate
- Clone or download this repository
- Navigate into the repository with
cd urban-model-server
and install the requirements withpip3 install --upgrade pip
andpip3 install -r requirements.txt
- Run the Setup file with
python3 setup.py install
- Adjust the config-dev.yml file as necessary
- Set the environment variables with
export PYGEOAPI_CONFIG=config-dev.yml
andexport PYGEOAPI_OPENAPI=example-openapi.yml
- Generate the openapi config file by running
pygeoapi openapi generate $PYGEOAPI_CONFIG > $PYGEOAPI_OPENAPI
- To start the development setup, run
pygeoapi serve
Make sure to have Docker and Docker Compose installed, adjust the production settings in the config-prod.yml file and simply run docker-compose up
.
⚠️ The current version of the Urban Model Server is still a prototype. If you want to use it in production, please carefully check for any possible security concerns.
pygeoapi is a Python server implementation of the OGC API suite of standards. The project emerged as part of the next generation OGC API efforts in 2018 and provides the capability for organizations to deploy a RESTful OGC API endpoint using OpenAPI, GeoJSON, and HTML. pygeoapi is open source and released under an MIT license.
Please read the docs at https://docs.pygeoapi.io for more information.