Skip to main content

actinia-tiling-plugin

This is an example plugin for actinia-core which adds a "Hello World" endpoint to actinia-core.

You can run actinia-tiling-plugin as actinia-core plugin.

Installation

Use docker-compose for installation:

docker-compose -f docker/docker-compose.yml build
docker-compose -f docker/docker-compose.yml up -d

Installation hints

  • If you get an error like: ERROR: for docker_kvdb_1 Cannot start service valkey: network xxx not found you can try the following:
docker-compose -f docker/docker-compose.yml down
# remove all custom networks not used by a container
docker network prune
docker-compose -f docker/docker-compose.yml up -d

DEV setup

For a DEV setup you can use the docker/docker-compose.yml:

docker-compose -f docker/docker-compose.yml build
docker-compose -f docker/docker-compose.yml run --rm --service-ports --entrypoint sh actinia

# install the plugin
(cd /src/actinia-tiling-plugin && pip3 install .)
# start actinia-core with your plugin
gunicorn -b 0.0.0.0:8088 -w 1 --access-logfile=- -k gthread actinia_core.main:flask_app

Hints

  • If you have no .git folder in the plugin folder, you need to set the SETUPTOOLS_SCM_PRETEND_VERSION before installing the plugin:
export SETUPTOOLS_SCM_PRETEND_VERSION=0.0

Otherwise you will get an error like this LookupError: setuptools-scm was unable to detect version for '/src/actinia-tiling-plugin'..

  • If you make changes in code and nothing changes you can try to uninstall the plugin:
pip3 uninstall actinia-tiling-plugin.wsgi -y
rm -rf /usr/lib/python3.8/site-packages/actinia_tiling_plugin.wsgi-*.egg

Running tests

You can run the tests in the actinia docker:

docker build -f docker/actinia-tiling-plugin-test/Dockerfile -t actinia-tiling-plugin-test .

docker run -it actinia-tiling-plugin-test -i

cd /src/actinia-tiling-plugin/

# run all tests
make test

For debugging the test this might be helpful when a waitAsyncStatusAssertHTTP fails:

from flask.json import loads as json_loads
resp_data = json_loads(rv.data)
rv_user_id = resp_data["user_id"]
rv_resource_id = resp_data["resource_id"]
rv2 = self.server.get(URL_PREFIX + "/resources/%s/%s" % (rv_user_id, rv_resource_id), headers=self.user_auth_header)
resp_data2 = json_loads(rv2.data)

Small Example

actinia_base_url=http://localhost:8088/api/v3
mapset_url=${actinia_base_url}/projects/loc_25832/mapsets/tiling_usermapset
auth="actinia-gdi:actinia-gdi"

Grid Tiling Example

# grid tiling
# the region should be set correctly
json_reg=test_postbodies/set_region_for_epsg25832.json
curl -u ${auth} -X POST ${mapset_url}/processing_async -H 'accept: application/json' -H 'Content-Type: application/json' -d @${json_reg} | jq
curl -u ${auth} -X GET ${mapset_url}/info | jq

# create tiling grid
curl -u ${auth} -X GET ${mapset_url}/vector_layers | jq
json=test_postbodies/grid_tiling_pb.json
curl -u ${auth} -X POST ${mapset_url}/tiling_processes/grid -H 'accept: application/json' -H 'Content-Type: application/json' -d @${json} | jq
curl -u ${auth} -X GET ${mapset_url}/vector_layers | jq

# request tiling_processes
curl -u ${auth} -X GET ${mapset_url}/tiling_processes | jq
curl -u ${auth} -X GET ${mapset_url}/tiling_processes/grid | jq

Processing Example as preparation for the merge

# process - tile 1
json=test_postbodies/grid_1_calulation.json
curl -u ${auth} -X POST ${mapset_url}_tmp1/processing_async -H 'accept: application/json' -H 'Content-Type: application/json' -d @${json} | jq
curl -u ${auth} -X GET  "http://localhost:8088/api/v3/resources/actinia-gdi/resource_id-..." | jq
curl -u ${auth} -X GET ${mapset_url}_tmp1/vector_layers | jq
curl -u ${auth} -X GET ${mapset_url}_tmp1/raster_layers | jq
curl -u ${auth} -X GET ${mapset_url}_tmp1/strds | jq

# process - tile 2
json=test_postbodies/grid_2_calulation.json
curl -u ${auth} -X POST ${mapset_url}_tmp2/processing_async -H 'accept: application/json' -H 'Content-Type: application/json' -d @${json} | jq
curl -u ${auth} -X GET  "http://localhost:8088/api/v3/resources/actinia-gdi/resource_id-..." | jq

# process - tile 3
json=test_postbodies/grid_3_calulation.json
curl -u ${auth} -X POST ${mapset_url}_tmp3/processing_async -H 'accept: application/json' -H 'Content-Type: application/json' -d @${json} | jq
curl -u ${auth} -X GET  "http://localhost:8088/api/v3/resources/actinia-gdi/resource_id-..." | jq

Patch merge Example

json=test_postbodies/patch_merge_no_mapset_deletion.json
json=test_postbodies/patch_merge.json
curl -u ${auth} -X POST ${mapset_url}/merge_processes/patch -H 'accept: application/json' -H 'Content-Type: application/json' -d @${json} | jq
curl -u ${auth} -X GET ${mapset_url}/vector_layers | jq
curl -u ${auth} -X GET ${mapset_url}/raster_layers | jq
curl -u ${auth} -X GET ${mapset_url}/strds | jq

curl -u ${auth} -X GET ${actinia_base_url}/projects/loc_25832/mapsets | jq

TODO

  • Region statt Vector speichern (wie res setzen?)

Metadata

Release files for actinia-tiling-plugin 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for actinia-tiling-plugin 1.2.0
File Size Uploaded Provenance Actions
actinia_tiling_plugin-1.2.0.tar.gz 30.9 kB Without provenance Details for actinia_tiling_plugin-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for actinia-tiling-plugin 1.2.0
File Interpreter ABI Platform Actions
actinia_tiling_plugin-1.2.0-py3-none-any.whl Python 3 none any Details for actinia_tiling_plugin-1.2.0-py3-none-any.whl

Total release size: 74.6 kB

Release files / actinia_tiling_plugin-1.2.0.tar.gz

Download URL actinia_tiling_plugin-1.2.0.tar.gz
Size 30.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7654cc427eb155952751a014ea46075d75ab600b218aa06f7b27ef0fee5aae84
BLAKE2b-256 checksum
How to use checksums
c8bb96133e836e0675c91c37ec0b0bff49c471f14d7197afbdfbc556e01a42ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / actinia_tiling_plugin-1.2.0-py3-none-any.whl

Download URL actinia_tiling_plugin-1.2.0-py3-none-any.whl
Size 43.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da5acaf01832c0c3f0e5207cd14605bd35e864ce385c92a75ec168a88e501738
BLAKE2b-256 checksum
How to use checksums
d5d0f0398f47b8bb4c68b94f2cb40b531f7cb8fb3095d55fbb3cee4cbbaace2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for actinia-tiling-plugin 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page