Skip to content

Satellite imagery patch similarity search using spectral indices and HNSW indexing

License

Notifications You must be signed in to change notification settings

bshepp/satvector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SatVector

Satellite imagery patch similarity search using spectral indices, texture features, and HNSW indexing.

Note: Forked from terravector and adapted for Earth observation data.

Overview

SatVector converts satellite imagery into searchable vector embeddings. Each image patch gets a "fingerprint" based on spectral indices, texture analysis, and signal decomposition. An HNSW index enables O(log N) similarity queries across millions of patches.

Use cases:

  • Find all patches similar to a known land cover type
  • Discover anomalies in satellite imagery
  • Transfer classification signatures across different regions
  • Rapid land cover classification without manual labeling
  • Change detection by comparing temporal signatures

Installation

git clone https://github.com/bshepp/satvector.git
cd satvector
pip install -r requirements.txt

Quick Start

Desktop Viewer (Recommended)

Launch the napari-based desktop viewer:

python viewer.py path/to/image.tif path/to/index.idx

Web UI

Launch the Gradio web interface:

python app.py

Command Line

# Build index from satellite image
python cli.py build image.tif --patch-size 64 --output satellite.idx

# Build with different signature types
python cli.py build image.tif --config vegetation --output veg.idx
python cli.py build image.tif --config urban --output urban.idx

# Query for similar patches
python cli.py query satellite.idx --patch 42 --k 10

# Query with visualization
python cli.py query satellite.idx --coords 500,200 --k 8 --visualize results.png

Signature Types

Spectral Indices

Vegetation and water indices from multispectral bands:

  • NDVI: Normalized Difference Vegetation Index
  • NDWI: Normalized Difference Water Index
  • EVI: Enhanced Vegetation Index
  • SAVI: Soil Adjusted Vegetation Index
  • NDBI: Normalized Difference Built-up Index
  • Band Ratios: Custom band ratio features

Texture Features

Image texture analysis:

  • GLCM: Gray-Level Co-occurrence Matrix
  • LBP: Local Binary Patterns

Decomposition

Signal processing from terravector:

  • Gaussian, Bilateral, Wavelet, Morphological filters

Presets

Preset Features Use Case
default Spectral + Texture General purpose
vegetation NDVI, EVI, SAVI + Texture Vegetation mapping
urban NDBI, texture, edges Urban detection
water NDWI, blue band stats Water body detection
agriculture NDVI temporal + texture Crop classification

Supported Formats

  • GeoTIFF (.tif, .tiff) - single or multi-band
  • JPEG2000 (.jp2) - Sentinel-2 format
  • NumPy (.npy) - preprocessed arrays

Requirements

  • Python 3.8+
  • numpy, scipy, scikit-image
  • rasterio (geospatial I/O)
  • nmslib (HNSW implementation)
  • gradio, napari (UI)

License

Apache 2.0

Citation

@software{satvector2025,
  author = {Shepp, B.},
  title = {SatVector: Satellite Imagery Patch Similarity Search},
  year = {2025},
  url = {https://github.com/bshepp/satvector}
}

About

Satellite imagery patch similarity search using spectral indices and HNSW indexing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages