Coder Social home page Coder Social logo

actinia-org / actinia-stac-plugin Goto Github PK

View Code? Open in Web Editor NEW
3.0 5.0 2.0 554 KB

Plugin for actinia to read STAC catalogs and retrieve data for processing

License: GNU General Public License v3.0

Python 97.19% Shell 1.54% Dockerfile 0.98% Makefile 0.28%
hacktoberfest stac actinia actinia-plugin

actinia-stac-plugin's Introduction

actinia-stac-plugin

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

Installation

For installation or DEV setup, see docker/README.md.

DEV notes:

Build

insprired by https://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/

to create a shippable wheel, run

pip3 install --upgrade pip pep517
python3 -m pep517.build .

Versioning:

https://semver.org/ (MAJOR.MINOR.PATCH)

Logging:

in any module, import from actinia_stac_plugin.resources.logging import log and call logger with log.info("my info i want to log")

actinia-stac-plugin's People

Contributors

anikaweinmann avatar joaherrerama avatar metzm avatar mmacata avatar neteler avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

actinia-stac-plugin's Issues

[Read] Analyse importer values and prepare process (chain piece)

  • actinia is responsible for reading in the needed collections, applying filters (space + time) to collect needed items and create the process chain for GRASS GIS
  • r.in.gdal / r.import will be used for all imports. actinia will pass information (data location, bands, extent, ...) -> the used location can be found out by the used endpoint.
  • single scenes are registered directly as STRDS
  • prepare for other filters but implementation is not part of this issue

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
docker/actinia-stac-tests/Dockerfile
github-actions
.github/workflows/linting.yml
.github/workflows/python-publish.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/setup-python v5
  • softprops/action-gh-release v2
.github/workflows/test.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • docker/setup-buildx-action v3
  • docker/build-push-action v6
pep621
pyproject.toml
  • setuptools >=40.6.0
pip_setup
setup.py
  • pyscaffold >=3.0a0,<3.1a0
  • stac-validator >=2.2.0
setup-cfg
setup.cfg

  • Check this box to trigger a request for Renovate to run again on this repository

remove `__pycache__` folders?

There are __pycache__ folders inside the folders, they should most probably be removed because they are generated when installing the plugin?

Check cards in Discover Board

In the board "Discover" for after the prototype, multiple cards were created. They need to be transformed into tickets if implementation should follow and prioritized.

[Read] Add type `stac` to actinia importer

Piece of process chain should look similar like this:

        {
            "id": "importer_1",
            "module": "importer",
            "inputs": [
                {
                    "import_descr": {
                        "source": "stac.example-instance-id.rastercube.example-collection-id",
                        "type": "stac",
                        "semantic_label": "red",
                        "extent": {
                            "spatial": {
                                "bbox":[[-180,-90,180,90]]
                            },
                             temporal":{"interval":[[
                                   "2021-09-09", "2021-09-12"
                             ]]}
                         },
                         "filter": {...}
                    },
                    "param": "map",
                    "value": "example-red"
                }
            ]
        },

Currently there is the parameter sentinel_band available in the importer. Although it would make sense to also use semantic_label for it, we don't touch it for now.

The goal of this ticket is not a full implementation to make this PC work but only a preparation to accept the PC, acknowledge the type stac and prepare for semantic_label, extent and filter. When using type stac in a process chain, actinia shouldn't start processing but return a message like "STAC import is coming soon" or similar.

Hint: the importer part of a process chain can also be used directly with a module, e.g.

    {
      "module": "g.region",
      "id": "g_region_1",
      "inputs": [
        {
          "import_descr": {
            "source": "https://storage.googleapis.com/graas-geodata/elev_ned_30m.tif",
            "type": "raster"
          },
          "param": "raster",
          "value": "elev_ned_30m_new"
        }
      ],
      "flags": "p"
    },

I suspect that this will work out of the box as well (as same code is executed) but it should be tested as well.

Also update API docs accordingly and prepare tests.

[Discover] Register - Support automated recognition of ressource

The stac-url can be any URL contained in a STAC catalog and actinia finds out, which type it is and registers collection(s).

Decision:

  • for item => superior collection
  • for catalog => follow child links 1x, if they are a collection, it will be registered
  • for collection => collection

in any case, the collection_id will be read and stored

How to find out type?

  • Item = type feature, from 1.0.0 type collection / catalog possible as well
  • before 1.0.0: if licenes + extent exists => collection, else catalog
  • see best-practices.md#how-to-differentiate-stac-files

[Result] Register result in STAC catalog

  • Requirement is that this can be done simply via an HTTP POST command containing the STAC json
  • This could be triggered with new parameter of exporter module
  • A different type of the webhook could be used for this. The postbody needs to be adjusted containing the STAC item and not the actinia resource will be done in separate task

[Read] Download to tmp folder / resource storage

The data should be downloaded to tmp folder / resource storage, where data will be deleted after processing / can be deleted manually -> look at other import options like sentinel

Also keep in mind that another option is mounting of data where actinia will not use the URL to download the resource but import directly from file path.

Add pipeline for linting

For each commit, a pipeline should be triggered to look at the PEP8 style guide rules. If they are not considered well, pipeline should fail. If there are valid reasons, a .flake8 file can be used to ignore certain violations.

A running example can be seen here

[COMMENT] IDs redundance in the endpoint `stac/collections`

The current endpoint list all collections stored in Redis regardless of the instance. The comment was given due to the fact that in this listing might happen that two or more COLLECTIONS provided from different endpoints might have the same ID. The suggestion was to create a prefix "index" that works as identifier for the providers and the STAC read.

Highlights:

  • The ID inside each STAC Collection is given by the provider, modifying them might not be a good approach.
  • The separation by the identifies in the stac/collections endpoint might work, but the effects in the reading in the OpenEO driver must be considered.
  • The concept of intances was not clear and maybe we can think about it relevance inside actinia and OpenEO

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.