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.1.tar.gz (2.4 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.1-py3-none-any.whl (44.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for nickyspatial-1.1.1.tar.gz
Algorithm Hash digest
SHA256 5283d4d55cb0a27c1d25d977ef7a3dbfe01ff15a094ae589359c2e433af527c1
MD5 42f65370b11cb34f16faebea0f8bda38
BLAKE2b-256 e60215c7393fce47e3c2bb892fa44d56c0dbf49cd2a9be3983140527a62d6e83

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nickyspatial-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7f15c076f2a6d1017b23b85b52fb1b375349bee78d1bbe3c45b6da2f91727c49
MD5 80550e5d386edccf2e29125412cd061e
BLAKE2b-256 9377b392e1d46e76309dd5787965f2108dd41188aba45ae5fae2a66e8e360f89

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