# open-eo/openeo-geotrellis-extensions architecture

> Architecture diagram of the GitHub repository open-eo/openeo-geotrellis-extensions, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/open-eo/openeo-geotrellis-extensions
- Repository: https://github.com/open-eo/openeo-geotrellis-extensions

## Overview

Key Components to Include:

##### Core Processing Layer
- "openeo-geotrellis" at the center as the main processing engine
- Connections to Apache Spark for distributed computing
- GeoTrellis integration for spatial operations
- OpenEO process implementation modules

##### Extension Modules (show as connected components)
- Accumulo Extensions (data storage)
- S3 Extensions (cloud storage)
- Sentinel Hub Integration
- Common Utilities
- Logging System

##### Data Flow Components
- Input Handlers (various file formats, STAC, NetCDF)
- Processing Pipeline
- Output Writers (GeoTIFF, PNG, NetCDF)

Design Guidelines:

##### Use a Layered Architecture
- ┌─────────────────────────────────────────┐
- Client Applications           │
- ┤
- OpenEO Process Interface        │
- ┤
- Geotrellis Processing Engine       │
- ┬──────────────┬──────────┤
- Accumulo   │     S3       │ Sentinel │
- Extensions  │  Extensions  │   Hub    │
- ┴──────────────┴──────────┘

##### Data Flow
- Transformation points
- Integration with external systems

##### Processing Components
- Atmospheric Correction
- Raster Operations
- Vector Operations
- Time Series Processing

- Blue: Core Processing Components
- Green: Storage Systems
- Orange: External Integrations
- Gray: Utility Services

Specific Implementation Details:
##### Distributed computing aspects

**┌──────┐ Core Components**

- ┘

**↔ Bidirectional Data Flow**
**→ Unidirectional Data Flow**

**🔷 Processing Node**
**⬡ Storage System**
**□ External Service**

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        CA[Client Applications]
    end

    subgraph ProcessInterface
        OPI[OpenEO Process Interface]
        click OPI "https://github.com/Open-EO/openeo-geotrellis-extensions/blob/develop/openeo-geotrellis/src/main/scala/org/openeo/geotrellis/OpenEOProcesses.scala"
    end

    subgraph ProcessingEngine
        GTE[GeoTrellis Engine]:::core
        Spark[Apache Spark]:::core
        
        subgraph DataProcessing
            IH[Input Handlers]:::process
            click IH "https://github.com/Open-EO/openeo-geotrellis-extensions/tree/develop/openeo-geotrellis/src/main/scala/org/openeo/geotrellis/file/"
            
            subgraph Processors
                AC[Atmospheric Correction]:::process
                click AC "https://github.com/Open-EO/openeo-geotrellis-extensions/tree/develop/openeo-geotrellis/src/main/scala/org/openeo/geotrellis/icor/"
                VO[Vector Operations]:::process
                click VO "https://github.com/Open-EO/openeo-geotrellis-extensions/tree/develop/openeo-geotrellis/src/main/scala/org/openeo/geotrellis/vector/"
                MA[Map Algebra]:::process
                click MA "https://github.com/Open-EO/openeo-geotrellis-extensions/tree/develop/openeo-geotrellis/src/main/scala/org/openeo/geotrellis/mapalgebra/"
                FO[Focal Operations]:::process
                click FO "https://github.com/Open-EO/openeo-geotrellis-extensions/tree/develop/openeo-geotrellis/src/main/scala/org/openeo/geotrellis/focal/"
            end
            
            subgraph OutputWriters
                GT[GeoTIFF Writer]:::output
                click GT "https://github.com/Open-EO/openeo-geotrellis-extensions/tree/develop/openeo-geotrellis/src/main/scala/org/openeo/geotrellis/geotiff/"
                NC[NetCDF Writer]:::output
                click NC "https://github.com/Open-EO/openeo-geotrellis-extensions/tree/develop/openeo-geotrellis/src/main/scala/org/openeo/geotrellis/netcdf/"
                PNG[PNG Writer]:::output
                click PNG "https://github.com/Open-EO/openeo-geotrellis-extensions/tree/develop/openeo-geotrellis/src/main/scala/org/openeo/geotrellis/png/"
            end
        end
    end

    subgraph Storage
        ACC[Accumulo Storage]:::storage
        click ACC "https://github.com/Open-EO/openeo-geotrellis-extensions/tree/develop/geotrellis-accumulo-extensions/src/main/scala/org/openeo/geotrellisaccumulo/"
        S3[S3 Storage]:::storage
        click S3 "https://github.com/Open-EO/openeo-geotrellis-extensions/tree/develop/geotrellis-s3-extensions/src/main/scala/org/openeo/geotrelliss3/"
    end

    subgraph DataManagement
        LP[Layer Providers]:::management
        click LP "https://github.com/Open-EO/openeo-geotrellis-extensions/tree/develop/openeo-geotrellis/src/main/scala/org/openeo/geotrellis/layers/"
        TG[Tile Grid Management]:::management
        click TG "https://github.com/Open-EO/openeo-geotrellis-extensions/tree/develop/openeo-geotrellis/src/main/scala/org/openeo/geotrellis/tile_grid/"
    end

    subgraph Support
        CU[Common Utilities]:::utility
        click CU "https://github.com/Open-EO/openeo-geotrellis-extensions/tree/develop/geotrellis-common/src/main/scala/org/openeo/geotrelliscommon/"
        LS[Logging System]:::utility
        click LS "https://github.com/Open-EO/openeo-geotrellis-extensions/tree/develop/openeo-logging/src/main/scala/org/openeo/logging/"
        SH[Sentinel Hub]:::external
        click SH "https://github.com/Open-EO/openeo-geotrellis-extensions/tree/develop/geotrellis-sentinelhub/src/main/scala/org/openeo/geotrellissentinelhub/"
    end

    CA --> OPI
    OPI --> GTE
    GTE <--> Spark
    
    GTE --> IH
    IH --> Processors
    Processors --> OutputWriters
    
    GTE <--> ACC
    GTE <--> S3
    GTE <--> SH
    
    GTE --> LP
    GTE --> TG
    
    CU -.-> GTE
    LS -.-> GTE

    classDef core fill:#2374ab
    classDef process fill:#48a9a6
    classDef output fill:#4ad66d
    classDef storage fill:#d4b483
    classDef management fill:#c1666b
    classDef utility fill:#a4a4a4
    classDef external fill:#e69f00

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[Processing Components]:::process
        L3[Output Components]:::output
        L4[Storage Systems]:::storage
        L5[Management]:::management
        L6[Utilities]:::utility
        L7[External Services]:::external
    end
```
