Skip to main content

Main subpackage of GeodataFlow, one Geoprocessing framework for geographical & Earth Observation (EO) data.

Project description

geodataflow.core

The main subpackage of GeodataFlow which implements basic building blocks (Pipeline engine & Modules) and commonly used functionalities.

GeodataFlow is a Geoprocessing framework for fetching, translating and manipulating Geospatial data (Raster, Vector, EO/STAC collections) by using a Pipeline or sequence of operations on input data. It is very much like the GDAL library which handles raster and vector data.

The project is split up into several namespace packages. geodataflow.core implements core functionalities: the Pipeline engine and a CLI tool to run workflows.

Workflow examples

Assuming you are using geodataflow.spatial (GDAL/OGR) as active backend implementation, GeodataFlow can run workflows as the following:

  • Converting a Shapefile to GeoPackage:

    # ==============================================================
    # Pipeline sample to convert a Shapefile to GeoPackage.
    # ==============================================================
    {
      "pipeline": [
        {
          "type": "FeatureReader",
          "connectionString": "input.shp"
        },
        # Extract the Centroid of input geometries.
        {
          "type": "GeometryCentroid"
        },
        # Transform CRS of geometries.
        {
          "type": "GeometryTransform",
          "sourceCrs": 4326,
          "targetCrs": 32630
        },
        # Save features to Geopackage.
        {
          "type": "FeatureWriter",
          "connectionString": "output.gpkg"
        }
      ]
    }
    
  • Fetching metadata of a S2L2A Product (STAC):

    # ==============================================================
    # Pipeline sample to fetch metadata of a S2L2A Product (STAC).
    # ==============================================================
    {
      "pipeline": [
        {
          "type": "FeatureReader",
    
          # Define the input AOI in an embedded GeoJson.
          "connectionString": {
            "type": "FeatureCollection",
            "crs": {
              "type": "name",
              "properties": { "name": "EPSG:4326" }
            },
            "features": [
              {
                "type": "Feature",
                "properties": { "id": 0, "name": "My AOI for testing" },
                "geometry": {
                  "type": "Polygon",
                  "coordinates": [[
                      [-1.746826,42.773227],
                      [-1.746826,42.860866],
                      [-1.558685,42.860866],
                      [-1.558685,42.773227],
                      [-1.746826,42.773227]
                  ]]
                }
              }
            ]
          }
        },
        # Transform CRS of geometries.
        {
          "type": "GeometryTransform",
          "sourceCrs": 4326,
          "targetCrs": 32630
        },
        # Fetch metadata of EO Products that match one SpatioTemporial criteria.
        {
          "type": "EOProductCatalog",
    
          "driver": "STAC",
          "provider": "https://earth-search.aws.element84.com/v0/search",
          "product": "sentinel-s2-l2a-cogs",
    
          "startDate": "2021-09-25",
          "endDate": "2021-10-05",
          "closestToDate": "2021-09-30",
          "filter": "",
    
          "preserveInputCrs": true
        },
        # Save features to Geopackage.
        {
          "type": "FeatureWriter",
          "connectionString": "output.gpkg"
        }
      ]
    }
    

Installation

geodataflow.core just provides basic built-in modules, you need to install one of available backends in order to have a complete list of useful modules.

Using pypi

To install the latest stable version from pypi, write this in the command-line:

> pip install geodataflow.core

To view all available CLI tool commands and options:

> geodataflow --help

Listing all available modules:

> geodataflow --modules

Using docker

Building the container with:

> docker build -f ./Dockerfile.core -t geodataflow/cli:1.0.0 .

Getting start:

> docker run --rm --name gdf geodataflow/cli:1.0.0 --help
> docker run --rm --name gdf geodataflow/cli:1.0.0 --modules

Creating an interactive bash shell:

> docker run --rm -it --entrypoint "bash" geodataflow/cli:1.0.0

Contribute

Have you spotted a typo in our documentation? Have you observed a bug while running GeodataFlow? Do you have a suggestion for a new feature?

Don't hesitate and open an issue or submit a pull request, contributions are most welcome!

License

GeodataFlow is licensed under Apache License v2.0. See LICENSE file for details.

Credits

GeodataFlow is built on top of amazingly useful open source projects. See NOTICE file for details about those projects and their licenses.

Thank you to all the authors of these projects!

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geodataflow.core-0.2.1.tar.gz (32.2 kB view details)

Uploaded Source

Built Distribution

geodataflow.core-0.2.1-py3-none-any.whl (48.3 kB view details)

Uploaded Python 3

File details

Details for the file geodataflow.core-0.2.1.tar.gz.

File metadata

  • Download URL: geodataflow.core-0.2.1.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for geodataflow.core-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a4daf7ec339ac6754f5454d4283cccc575233aa6578645cdf8c3a6a4d792759d
MD5 44676127cae78faf17a802e2719c2e2b
BLAKE2b-256 567849010dc67eef3822dbd8c92925770a6d1343b74ea542ec95be60dc6a3c0a

See more details on using hashes here.

File details

Details for the file geodataflow.core-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for geodataflow.core-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fdd4f1f36b4f09aa391a45f9ea2034a7ff4f38545eeb0f9f0dcbbba662ed2a1d
MD5 b55185cbdb4d7c67a4109a54c585df84
BLAKE2b-256 cce6c0bcb26d200b172c1f1f7d3c5cdb22e341f9213571e9245b2b78ea1c2c20

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page