Rest API for orka vector data
Project description
OrKa-Vector-API
The OrKa Vector REST API
Commands
run dev server
start application
FLASK_APP=orka_vector_api FLASK_ENV=development flask run
run prod server from another venv (waitress)
waitress-serve --call 'orka_vector_api:create_app'
DB
POSTGIS extension needs to be installed on orka db.
create extension postgis;
installation
create user writeable folders /var/log/orka_vector_api/
and /var/orka_vector_api/
build
see https://flask.palletsprojects.com/en/1.1.x/tutorial/deploy/
Configs
config.py
A config.py
must be added to the instance folder
that allows following additional configs:
PG_USER
- username of the user that has access to the vector layersPG_PASSWORD
= password of the userPG_HOST
= database hostPG_PORT
= database portPG_DATABASE
= database nameORKA_DB_USER
= application database usernameORKA_DB_PASSWORD
= application database passwordORKA_DB_HOST
= application database hostORKA_DB_PORT
= application database portORKA_DB_DATABASE
= application database nameORKA_DB_SCHEMA
= application database schemaORKA_DB_MIN_CONNECTION
= application database min connectionsORKA_DB_MAX_CONNECTION
= application database max connectionsORKA_GPKG_PATH
= path to where the created gpkg files should be placedORKA_LAYERS_PATH
= path to folder containing the layer sqls. This folder must be located within the instance folderORKA_THREAD_TIMEOUT
= timeout in seconds after which a running thread should be killed.ORKA_MAX_THREADS
= number of allowed threadsORKA_LOG_FILE
= path to log fileORKA_STYLE_PATH
= path to the file that contains all styles, etc.ORKA_STYLE_FILE
= name of the zip file (including.zip
) that contains all styles, etc.ORKA_MAX_BBOX
= maximum allowed size of the bbox in sqkm.
Example config.py:
PG_USER = 'user'
PG_PASSWORD = 'password'
PG_HOST = 'localhost'
PG_PORT = 5432
PG_DATABASE = 'postgres'
ORKA_DB_USER = 'user2'
ORKA_DB_PASSWORD = 'password2'
ORKA_DB_HOST = 'localhost'
ORKA_DB_PORT = 5555
ORKA_DB_DATABASE = 'postgres'
ORKA_DB_SCHEMA = 'public'
ORKA_DB_MIN_CONNECTION = 1
ORKA_DB_MAX_CONNECTION = 1
ORKA_GPKG_PATH = 'data/'
ORKA_LAYERS_PATH = 'layers/'
ORKA_THREAD_TIMEOUT = 60
ORKA_MAX_THREADS = 4
ORKA_LOG_FILE = '/var/log/orka_vector_api/orka_vector_api.log'
ORKA_STYLE_PATH = 'styles/'
ORKA_STYLE_FILE = 'style.zip'
ORKA_MAX_BBOX = 10000
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
orka_vector_api-0.0.1.tar.gz
(14.8 kB
view hashes)
Built Distribution
Close
Hashes for orka_vector_api-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d5463ea985bb676d8fa67d43c183c20f23b83e03f0fdee11397f6c11b3e41ee |
|
MD5 | 3c66ac7c55b79d9a9f8d1333b7f58dc3 |
|
BLAKE2b-256 | b3a6fd52ff55b7d575911fbdfa78dc6fab10da2e1a1cdce36930ced1bace67b0 |