Metadata-Version: 2.4
Name: surtgis
Version: 0.1.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: GIS
Classifier: Topic :: Scientific/Engineering :: Image Processing
Requires-Dist: numpy>=1.20 ; extra == 'numpy'
Provides-Extra: numpy
Summary: High-performance geospatial analysis library for Python, powered by Rust
Keywords: gis,geospatial,terrain,raster,hydrology,dem,rust
Author-email: Francisco Parra <francisco.parra.o@usach.cl>
License: MIT OR Apache-2.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Bug Tracker, https://github.com/franciscoparrao/surtgis/issues
Project-URL: Documentation, https://docs.rs/surtgis
Project-URL: Homepage, https://github.com/franciscoparrao/surtgis
Project-URL: Repository, https://github.com/franciscoparrao/surtgis

# surtgis

High-performance geospatial analysis library for Python, powered by Rust.

SurtGIS provides 30+ terrain, hydrology, and imagery algorithms with native performance through PyO3 bindings.

## Installation

```bash
pip install surtgis
```

## Quick Start

```python
import numpy as np
import surtgis

# Create a sample DEM (100x100 grid)
dem = np.random.rand(100, 100) * 100  # Elevation in meters
cell_size = 30.0  # 30m resolution

# Compute terrain derivatives
slope = surtgis.slope(dem, cell_size)
aspect = surtgis.aspect(dem, cell_size)
hillshade = surtgis.hillshade(dem, cell_size, azimuth=315.0, altitude=45.0)

# Curvature analysis
profile_curv = surtgis.curvature(dem, cell_size, curvature_type="profile")
plan_curv = surtgis.curvature(dem, cell_size, curvature_type="plan")

# Hydrology
twi = surtgis.twi(dem, cell_size)  # Topographic Wetness Index
tpi = surtgis.tpi(dem, cell_size, radius=3)  # Topographic Position Index
tri = surtgis.tri(dem, cell_size)  # Terrain Ruggedness Index

print(f"Slope range: {slope.min():.1f}° - {slope.max():.1f}°")
print(f"TWI range: {twi.min():.2f} - {twi.max():.2f}")
```

## Available Functions

### Terrain Analysis

| Function | Description |
|----------|-------------|
| `slope(dem, cell_size)` | Slope in degrees |
| `aspect(dem, cell_size)` | Aspect in degrees (0-360) |
| `hillshade(dem, cell_size, azimuth, altitude)` | Analytical hillshade |
| `curvature(dem, cell_size, curvature_type)` | Profile, plan, or general curvature |
| `tpi(dem, cell_size, radius)` | Topographic Position Index |
| `tri(dem, cell_size)` | Terrain Ruggedness Index |
| `twi(dem, cell_size)` | Topographic Wetness Index |
| `geomorphons(dem, cell_size, flatness, radius)` | Landform classification |
| `northness(dem, cell_size)` | Cosine of aspect |
| `eastness(dem, cell_size)` | Sine of aspect |
| `dev(dem, cell_size, radius)` | Deviation from Mean Elevation |
| `multidirectional_hillshade(dem, cell_size)` | Multi-azimuth hillshade |

### Imagery

| Function | Description |
|----------|-------------|
| `ndvi(nir, red)` | Normalized Difference Vegetation Index |
| `ndwi(green, nir)` | Normalized Difference Water Index |
| `savi(nir, red, l_factor)` | Soil-Adjusted Vegetation Index |

## Performance

SurtGIS is 5-10x faster than pure Python implementations thanks to Rust's zero-cost abstractions and automatic parallelization via Rayon.

## License

MIT OR Apache-2.0

