Skip to main content

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

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

Metadata

Release files for nickyspatial 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nickyspatial 1.1.1
File Size Uploaded
nickyspatial-1.1.1.tar.gz 2.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for nickyspatial 1.1.1
File Interpreter ABI Platform
nickyspatial-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 2.5 MB

Release files / nickyspatial-1.1.1.tar.gz

Download URL nickyspatial-1.1.1.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
5283d4d55cb0a27c1d25d977ef7a3dbfe01ff15a094ae589359c2e433af527c1
BLAKE2b-256 checksum
How to use checksums
e60215c7393fce47e3c2bb892fa44d56c0dbf49cd2a9be3983140527a62d6e83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.14

Release files / nickyspatial-1.1.1-py3-none-any.whl

Download URL nickyspatial-1.1.1-py3-none-any.whl
Size 44.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f15c076f2a6d1017b23b85b52fb1b375349bee78d1bbe3c45b6da2f91727c49
BLAKE2b-256 checksum
How to use checksums
9377b392e1d46e76309dd5787965f2108dd41188aba45ae5fae2a66e8e360f89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.14

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.2.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.5

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page