PHPackages                             geomin/geomin-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. geomin/geomin-laravel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

geomin/geomin-laravel
=====================

Laravel geophysics library for satellite-based mining activity detection and mineral identification

v0.1(5mo ago)00MITPHPPHP ^8.1|^8.2

Since Jan 17Pushed 5mo agoCompare

[ Source](https://github.com/kazashim/GeoMin-Laravel)[ Packagist](https://packagist.org/packages/geomin/geomin-laravel)[ Docs](https://github.com/kazashim/GeoMin-Laravel)[ RSS](/packages/geomin-geomin-laravel/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (10)Versions (2)Used By (0)

GeoMin Laravel
==============

[](#geomin-laravel)

[![GeoMin Laravel](https://camo.githubusercontent.com/e6d4e3eb04eda84ea2b405f97b97b92d84dbca792381406ae7eaf75d489987d5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67656f6d696e2f67656f6d696e2d6c61726176656c2e737667)](https://camo.githubusercontent.com/e6d4e3eb04eda84ea2b405f97b97b92d84dbca792381406ae7eaf75d489987d5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67656f6d696e2f67656f6d696e2d6c61726176656c2e737667)[![License](https://camo.githubusercontent.com/a05c80d364ee0a19e1d47adaf776a8614170b5fd356edc9b393034e055be3cad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c6963656e73652f67656f6d696e2f67656f6d696e2d6c61726176656c2e737667)](https://camo.githubusercontent.com/a05c80d364ee0a19e1d47adaf776a8614170b5fd356edc9b393034e055be3cad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c6963656e73652f67656f6d696e2f67656f6d696e2d6c61726176656c2e737667)[![PHP](https://camo.githubusercontent.com/c4f57ecbec93878e1e0a9a26942cf69fcb5edca00c642a90f6e13e44cf93354d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f67656f6d696e2f67656f6d696e2d6c61726176656c2e737667)](https://camo.githubusercontent.com/c4f57ecbec93878e1e0a9a26942cf69fcb5edca00c642a90f6e13e44cf93354d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f67656f6d696e2f67656f6d696e2d6c61726176656c2e737667)

Laravel geophysics library for satellite-based mining activity detection and mineral identification. This package provides a comprehensive set of tools for analyzing satellite imagery to identify potential mineral deposits and mining activity.

Features
--------

[](#features)

- **STAC Client**: Query and download satellite imagery from multiple providers (AWS Earth Search, Microsoft Planetary Computer, etc.)
- **Anomaly Detection**: Machine learning algorithms to identify spectral anomalies (Isolation Forest, RX Detector, Local Outlier Factor)
- **Cloud Masking**: Automatic cloud detection and removal for preprocessing
- **Advanced Mineralogy**: Crosta PCA, Spectral Angle Mapper (SAM), and Linear Spectral Unmixing
- **Spectral Indices**: Calculate common indices (NDVI, NDWI, Iron Oxide Ratio, Clay Ratio, etc.)
- **Queue Support**: Heavy processing jobs can be dispatched to queues for background execution
- **Eloquent Integration**: Store and track analysis results in the database

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 10 or 11
- Composer
- Extension: ext-json, ext-curl, ext-gd

Installation
------------

[](#installation)

1. Install via Composer:

```
composer require geomin/geomin-laravel
```

2. Publish the configuration:

```
php artisan vendor:publish --provider="GeoMin\Providers\GeoMinServiceProvider"
```

3. Run the migrations:

```
php artisan migrate
```

Configuration
-------------

[](#configuration)

Configure GeoMin by editing `config/geomin.php`:

```
return [
    // STAC Client Configuration
    'stac' => [
        'endpoint' => env('GEOMIN_STAC_ENDPOINT', 'aws'),
        'api_key' => env('GEOMIN_STAC_API_KEY'),
        'default_collection' => 'sentinel-2-l2a',
        'timeout' => 60,
        'max_results' => 100,
        'cache_enabled' => true,
        'cache_ttl' => 60,
    ],

    // Anomaly Detection
    'anomaly' => [
        'isolation_forest' => [
            'trees' => 100,
            'contamination' => 0.01,
        ],
        'rx' => [
            'threshold' => 0.99,
            'window_size' => null,
        ],
        'lof' => [
            'neighbors' => 20,
            'contamination' => 0.01,
        ],
    ],

    // Cloud Masking
    'cloud_masking' => [
        'default_algorithm' => 'sentinel2',
        'sentinel2' => [
            'blue_threshold' => 0.3,
            'nir_threshold' => 0.4,
            'swir_ratio_threshold' => 0.75,
        ],
    ],

    // Queue Configuration
    'queue' => [
        'connection' => 'redis',
        'queue' => 'geomin',
        'timeout' => 3600,
        'max_retries' => 3,
    ],
];
```

Usage
-----

[](#usage)

### Using the Facade

[](#using-the-facade)

```
use GeoMin\Facades\GeoMin;

// Search for satellite imagery
$results = GeoMin::stac()
    ->collection('sentinel-2-l2a')
    ->bbox([115.0, -32.0, 115.5, -31.5])
    ->date('2023-01-01', '2023-12-31')
    ->cloudCover(10)
    ->get();

// Calculate spectral index
$result = GeoMin::spectral()->calculateIndex($bands, 'ndvi');

// Detect anomalies
$result = GeoMin::detectAnomalies($imageData, 'isolation_forest', [
    'contamination' => 0.02,
]);

// Apply cloud masking
$result = GeoMin::cloudMasker()->mask($imageData, 'sentinel2');

// Perform Crosta PCA
$result = GeoMin::crostaPCA($imageData, 'hydroxyl');
```

### CLI Commands

[](#cli-commands)

GeoMin provides several Artisan commands for command-line usage:

#### Fetch Satellite Data

[](#fetch-satellite-data)

```
# Search for imagery in a bounding box
php artisan geomin:fetch --bbox="[115.0,-32.0,115.5,-31.5]" --cloud-cover=10

# Search with date range
php artisan geomin:fetch --date="2023-01-01/2023-12-31" --collection="sentinel-2-l2a"

# Dry run (show results without downloading)
php artisan geomin:fetch --bbox="[115.0,-32.0,115.5,-31.5]" --dry-run
```

#### Calculate Spectral Index

[](#calculate-spectral-index)

```
# Calculate NDVI
php artisan geomin:index path/to/bands.json --index=NDVI

# Calculate multiple indices
php artisan geomin:index path/to/bands.json --index=iron_oxide,clay --output=/path/to/results

# Save as CSV
php artisan geomin:index path/to/bands.json --index=NDVI --format=csv
```

#### Detect Anomalies

[](#detect-anomalies)

```
# Using RX Detector
php artisan geomin:detect path/to/image.json --algorithm=rx

# Using Isolation Forest
php artisan geomin:detect path/to/image.json --algorithm=isolation_forest --contamination=0.02

# Dispatch to queue
php artisan geomin:detect path/to/image.json --algorithm=rx --queue
```

#### Mineral Mapping

[](#mineral-mapping)

```
# Crosta PCA for hydroxyl alteration
php artisan geomin:mineral path/to/image.json --method=crosta --target=hydroxyl

# Spectral Angle Mapper
php artisan geomin:mineral path/to/image.json --method=sam --mineral=kaolinite

# Spectral Unmixing
php artisan geomin:mineral path/to/image.json --method=unmixing --endmembers=kaolinite,hematite
```

#### Cloud Masking

[](#cloud-masking)

```
# Apply cloud masking
php artisan geomin:mask path/to/image.json --algorithm=sentinel2

# Generate cloud probability visualization
php artisan geomin:mask path/to/image.json --visualize --output=/path/to/results
```

### Working with Results

[](#working-with-results)

```
use GeoMin\Models\SpatialAnalysis;

// Get analysis by ID
$analysis = SpatialAnalysis::find(1);

// Check status
if ($analysis->isCompleted()) {
    $result = $analysis->getResult();

    // Access statistics
    $stats = $result['statistics'] ?? [];

    // Access anomaly locations
    $locations = $result['top_locations'] ?? [];
}

// Get user's analyses
$analyses = SpatialAnalysis::forUser(auth()->id())
    ->recent(7)
    ->get();
```

### Queue Processing

[](#queue-processing)

For large datasets, dispatch jobs to the queue:

```
use GeoMin\Facades\GeoMin;

// Dispatch anomaly detection to queue
$analysis = GeoMin::dispatchProcessingJob($path, 'anomaly_detection', [
    'algorithm' => 'isolation_forest',
    'contamination' => 0.01,
]);

// Check status later
$status = $analysis->status;
```

Available Spectral Indices
--------------------------

[](#available-spectral-indices)

IndexFormulaDescriptionNDVI(nir - red) / (nir + red)Vegetation healthNDWI(green - nir) / (green + nir)Water contentNDMI(nir - swir1) / (nir + swir1)Moisture indexIron Oxidered / blueIron oxide mineralsClayswir1 / swir2Clay mineralsFerrous(nir - swir1) / (nir + swir1)Ferrous ironAvailable Reference Minerals
----------------------------

[](#available-reference-minerals)

- Kaolinite, Alunite, Jarosite (Clay/Sulfate)
- Hematite, Goethite (Iron Oxide)
- Sericite, Chlorite (Phyllosilicate)
- Calcite, Dolomite (Carbonate)
- Muscovite, Biotite (Mica)
- Quartz, Feldspar

STAC Endpoints
--------------

[](#stac-endpoints)

The package supports multiple STAC providers:

NameEndpointCollectionsAWSearth-search.aws.element84.com/v1Sentinel-2, LandsatPlanetary Computerplanetarycomputer.microsoft.com/api/stac/v1Sentinel-2, Landsat, MODISElement84api.stac.terrascope.be/v1Sentinel-2USGSlandsatlook.usgs.gov/stacLandsatEvents
------

[](#events)

GeoMin dispatches events during analysis lifecycle:

```
use GeoMin\Events\AnalysisCompleted;
use GeoMin\Events\AnalysisFailed;
use GeoMin\Events\AnalysisStarted;

// Listen for events
Event::listen(function (AnalysisStarted $event) {
    Log::info("Analysis {$event->getAnalysisId()} started");
});

Event::listen(function (AnalysisCompleted $event) {
    Log::info("Analysis {$event->getAnalysisId()} completed");
});

Event::listen(function (AnalysisFailed $event) {
    Log::error("Analysis {$event->getAnalysisId()} failed: {$event->error}");
});
```

Exception Handling
------------------

[](#exception-handling)

```
use GeoMin\Exceptions\STACException;
use GeoMin\Exceptions\AnalysisException;

try {
    $results = GeoMin::stac()->search($options);
} catch (STACException $e) {
    Log::error('STAC error', ['message' => $e->getFullMessage()]);
}

try {
    $result = GeoMin::detectAnomalies($data, $algorithm);
} catch (AnalysisException $e) {
    Log::error('Analysis error', ['context' => $e->getContext()]);
}
```

Testing
-------

[](#testing)

```
# Run tests
./vendor/bin/phpunit

# Run with coverage
./vendor/bin/phpunit --coverage-html coverage
```

Performance Considerations
--------------------------

[](#performance-considerations)

1. **Memory Usage**: Large images can consume significant memory. Consider:

    - Increasing memory\_limit in php.ini
    - Using chunked processing for very large images
    - Dispatching to queue for background processing
2. **Queue Configuration**: For production:

    ```
    'queue' => [
        'connection' => 'redis',
        'queue' => 'geomin',
        'timeout' => 3600,
        'max_retries' => 3,
    ],
    ```
3. **Caching**: STAC search results are cached by default. Adjust cache TTL based on your needs.

Contributing
------------

[](#contributing)

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE) file for more information.

Author
------

[](#author)

**Kazashim Kuzasuwat**

- [GitHub](https://github.com/kazashim)
- [Email](mailto:kazashimkuzasuwat@gmail.com)

Links
-----

[](#links)

- [Package Repository](https://github.com/kazashim/GeoMin-Laravel)
- [Issue Tracker](https://github.com/kazashim/GeoMin-Laravel/issues)
- [Python Version](https://github.com/kazashim/GeoMin)

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance70

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

169d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12492093?v=4)[kazashim kuzasuwat](/maintainers/kazashim)[@kazashim](https://github.com/kazashim)

---

Top Contributors

[![kazashim](https://avatars.githubusercontent.com/u/12492093?v=4)](https://github.com/kazashim "kazashim (3 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/geomin-geomin-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/geomin-geomin-laravel/health.svg)](https://phpackages.com/packages/geomin-geomin-laravel)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M993](/packages/statamic-cms)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k14.2M63](/packages/knuckleswtf-scribe)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M577](/packages/shopware-core)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
