Skip to main content

An open-source object-based image analysis library for remote sensing.

Project description

NickySpatial

An open-source object-based image analysis library for remote sensing.

Category Badge
Build uv hatchling pre-commit.ci status
Code Quality Ruff pre-commit Tests Coverage
Documentation MkDocs Read DeepWiki
Package Info Python PyPI version Dependencies License
Community GitHub Stars Issues Downloads Last Commit

[!WARNING] This project is under active development and lot of its functionality is still in my head yet to code.

Find Demo Frontend Here : https://nickyspatial-gpoqz.ondigitalocean.app/

Description

NickySpatial is a Python package that provides object-based image analysis (OBIA) functionality similar to commercial software like eCognition. It allows users to segment geospatial imagery into meaningful objects, calculate statistics, and apply rule-based classification.

Project Structure

nickyspatial/
├── __init__.py
├── io/
   ├── __init__.py
   ├── raster.py       # Raster I/O
   └── vector.py       # Vector I/O
├── core/
   ├── __init__.py
   ├── layer.py        # Layer class and management
   ├── segmentation.py # Segmentation algorithms
   └── rules.py        # Rule engine
|   └── classifier.py   # Classification algorithms
├── stats/
   ├── __init__.py
   ├── basic.py        # Basic statistics (min, max, mean, etc.)
   ├── spatial.py      # Spatial statistics (area, perimeter, etc.)
   └── spectral.py     # Spectral indices (NDVI, etc.)
├── filters/
   ├── __init__.py
   ├── spatial.py      # Spatial filters (smoothing, merging)
   └── spectral.py     # Spectral filters (band math)
├── viz/
   ├── __init__.py
   ├── maps.py         # Map visualization
   └── charts.py       # Statistical charts
└── utils/
    ├── __init__.py
    └── helpers.py      # Helper functions

Installation

pip install nickyspatial

Quick Start

import nickyspatial as ns

# Load a raster image
layer = ns.read_raster("path/to/your/satellite_image.tif")

# Perform segmentation
segments = ns.SlicSegmentation(scale=20, compactness=0.5)
segmented_layer = segments.execute(layer.raster, layer.transform, layer.crs)

# Calculate statistics
ns.attach_basic_stats(segmented_layer, "mean_intensity")
ns.attach_area_stats(segmented_layer)
ns.attach_spectral_indices(segmented_layer, indices=["ndvi"])

# Apply rules for classification
ruleset = ns.RuleSet(name="Land_Cover")
ruleset.add_rule(name="vegetation", condition="ndvi > 0.3 & area_units > 100")
classified_layer = ruleset.execute(segmented_layer, result_field="classification")

# Visualize results
ns.plot_layer_interactive(classified_layer, "classification")

Documentation

For detailed documentation and examples, see the documentation website. Deepwiki also provides documentation quite detailed , Do check it out if you like

Examples

Check out our comprehensive examples:

Key Features Demonstrated:

  • Image Segmentation: SLIC algorithm for object-based analysis
  • Statistical Analysis: Calculate spatial, spectral, and basic statistics
  • Classification: Both traditional ML and deep learning approaches
  • Rule Engine: Apply custom rules for object classification
  • Visualization: Interactive maps and statistical charts
  • I/O Operations: Read/write raster and vector formats

Contributing

Contributions are welcome! Follow dev setup guide & Please feel free to submit a Pull Request.

Acknowledgments

  • Inspired by the functionality of eCognition and other OBIA methodologies
  • Built on top of powerful open-source libraries like numpy, rasterio, scikit-image, and GeoPandas
  • Nicky : Nicky is my belated dog and I named this package in his memory!

    Nicky the dog

Contributors

Contributors

Project details


Download files

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

Source Distribution

nickyspatial-1.1.0.tar.gz (14.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nickyspatial-1.1.0-py3-none-any.whl (37.1 kB view details)

Uploaded Python 3

File details

Details for the file nickyspatial-1.1.0.tar.gz.

File metadata

  • Download URL: nickyspatial-1.1.0.tar.gz
  • Upload date:
  • Size: 14.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.14

File hashes

Hashes for nickyspatial-1.1.0.tar.gz
Algorithm Hash digest
SHA256 1ab1bb34e32707eaa788ed8893a8b16b289fea1cf5404e6193315eb965760d8f
MD5 7c8c36d893dde287a43d3946e3f791ec
BLAKE2b-256 a883963739202bf362dee5dea3f2cb7891b1d4f690d2e4669efc5f8db2e21164

See more details on using hashes here.

File details

Details for the file nickyspatial-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nickyspatial-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7bd615de0234bc1fcebc08102d9f7153934c4d18bd69aa4879532aa033955107
MD5 d1dc0ab2a995701f95885888b6ead1a2
BLAKE2b-256 e939a63ae6ca1f8e557f4ed2cbf360725adc7f00b712a2a8625ecbdee6bc9f86

See more details on using hashes here.

Supported by

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