Satellite imagery patch similarity search using spectral indices, texture features, and HNSW indexing.
Note: Forked from terravector and adapted for Earth observation data.
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
git clone https://github.com/bshepp/satvector.git
cd satvector
pip install -r requirements.txtLaunch the napari-based desktop viewer:
python viewer.py path/to/image.tif path/to/index.idxLaunch the Gradio web interface:
python app.py# 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.pngVegetation 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
Image texture analysis:
- GLCM: Gray-Level Co-occurrence Matrix
- LBP: Local Binary Patterns
Signal processing from terravector:
- Gaussian, Bilateral, Wavelet, Morphological filters
| 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 |
- GeoTIFF (.tif, .tiff) - single or multi-band
- JPEG2000 (.jp2) - Sentinel-2 format
- NumPy (.npy) - preprocessed arrays
- Python 3.8+
- numpy, scipy, scikit-image
- rasterio (geospatial I/O)
- nmslib (HNSW implementation)
- gradio, napari (UI)
Apache 2.0
@software{satvector2025,
author = {Shepp, B.},
title = {SatVector: Satellite Imagery Patch Similarity Search},
year = {2025},
url = {https://github.com/bshepp/satvector}
}