Skip to content

This is a REST API that allows calling algorithms written in QGIS processing framework through http requests.

Notifications You must be signed in to change notification settings

ar-siddiqui/qgis-processing-rest-api

Repository files navigation

qgis-processing-rest-api 🌍⚙

Description

This is a REST API that allows calling algorithms written in QGIS processing framework through http requests.

QGIS processing framework guide: https://docs.qgis.org/3.22/en/docs/user_manual/processing/index.html

Capabilities

GET /ping - check the status of the API

GET /list - lisg all QGIS processing algorithms available and their provider_id and algorithm_id

GET /help/<provider_id>/<algorithm_id> - return help and documentation for the specified algorithm

POST /process/<provider_id>/<algorithm_id> - process the specified algorithm with given data. Accepts JSON produces JSON.

Contents

.
├── app
│   ├── logs
│   ├── app.py
│   ├── executer.py
│   ├── helpers.py
│   └── utils.py
├── docs
│   └── postman_collection.json
├── test-data
│   ├── benchmarks
│   ├── inputs
│       └── ...
│   └── outputs
├── Dockerfile
├── docker-compose.yml
├── plugins.txt
├── readme.md
└── requirements.txt

Getting started

  1. Clone the repository
  2. Add an .env file
  3. $docker-compose build
  4. $docker-compose up
  5. Go to http://localhost:5000/ping
  6. Read documention http://localhost:5000/apidocs

Example request

curl --location --request POST 'http://localhost:5000/process/native/buffer' \
--header 'Content-Type: application/json' \
--data-raw '{
    "INPUT": "/test-data/inputs/aoi.shp",
    "DISTANCE": 0.01,
    "SEGMENTS": 5,
    "END_CAP_STYLE": 0,
    "JOIN_STYLE": 0,
    "MITER_LIMIT": 2,
    "DISSOLVE": false,
    "OUTPUT": "/test-data/outputs/buffer/aoi_buff.shp"
}'

Environment file

FLASK_ENV="development"

DEBUG="TRUE"
TIMEZONE="US/Eastern"

About

This is a REST API that allows calling algorithms written in QGIS processing framework through http requests.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published