Skip to main content

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

Project description

surtgis

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

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

Installation

pip install surtgis

Quick Start

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_degrees(dem, cell_size)
hillshade = surtgis.hillshade_compute(dem, cell_size, azimuth=315.0, altitude=45.0)

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

# Advanced Florinsky curvatures (14 types available)
mean_h = surtgis.advanced_curvature(dem, cell_size, ctype="mean_h")
gaussian_k = surtgis.advanced_curvature(dem, cell_size, ctype="gaussian_k")

# Hydrology
twi = surtgis.twi_compute(dem, cell_size)  # Topographic Wetness Index
hand = surtgis.hand_compute(dem, cell_size)  # Height Above Nearest Drainage

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

Available Functions

Terrain Analysis (21 functions)

Function Description
slope(dem, cell_size) Slope in degrees or percent
aspect_degrees(dem, cell_size) Aspect in degrees (0-360)
hillshade_compute(dem, cell_size, azimuth, altitude) Analytical hillshade
multidirectional_hillshade(dem, cell_size) Multi-azimuth hillshade
curvature_compute(dem, cell_size, ctype) Profile, plan, or general curvature
advanced_curvature(dem, cell_size, ctype) 14 Florinsky curvatures
tpi_compute(dem, cell_size, radius) Topographic Position Index
tri_compute(dem, cell_size) Terrain Ruggedness Index
dev_compute(dem, cell_size, radius) Deviation from Mean Elevation
vrm_compute(dem, cell_size, radius) Vector Ruggedness Measure
geomorphons_compute(dem, cell_size, flatness, radius) Landform classification
mrvbf_compute(dem, cell_size) Multi-resolution Valley Bottom Flatness
northness_compute(dem, cell_size) Cosine of aspect
eastness_compute(dem, cell_size) Sine of aspect
shape_index_compute(dem, cell_size) Shape index
curvedness_compute(dem, cell_size) Curvedness
sky_view_factor_compute(dem, cell_size) Sky View Factor
viewshed_compute(dem, cell_size, observer_row, observer_col) Line-of-sight visibility
openness_positive(dem, cell_size) Positive openness
openness_negative(dem, cell_size) Negative openness
uncertainty_slope(dem, cell_size, dem_rmse) Slope uncertainty from DEM error

Hydrology (9 functions)

Function Description
fill_depressions(dem, cell_size) Planchon-Darboux sink filling
priority_flood_fill(dem, cell_size) Priority-Flood (Barnes 2014)
breach_fill(dem, cell_size) Breach depressions (Lindsay 2016)
flow_direction_d8(dem, cell_size) D8 flow direction
flow_accumulation_d8(fdir, cell_size) D8 flow accumulation
flow_accumulation_mfd_compute(dem, cell_size) Multi-flow direction accumulation
twi_compute(dem, cell_size) Topographic Wetness Index
hand_compute(dem, cell_size) Height Above Nearest Drainage
stream_network_compute(dem, cell_size, threshold) Stream network extraction

Imagery (4 functions)

Function Description
ndvi_compute(nir, red) Normalized Difference Vegetation Index
ndwi_compute(green, nir) Normalized Difference Water Index
savi_compute(nir, red, l_factor) Soil-Adjusted Vegetation Index
normalized_diff(a, b) Generic normalized difference

Morphology (4 functions)

Function Description
morph_erode(data, radius) Morphological erosion
morph_dilate(data, radius) Morphological dilation
morph_opening(data, radius) Morphological opening
morph_closing(data, radius) Morphological closing

Statistics (3 functions)

Function Description
focal_mean(data, radius) Focal mean
focal_std(data, radius) Focal standard deviation
focal_range(data, radius) Focal range (max - min)

Advanced Curvature Types

The advanced_curvature function supports 14 curvature types from Florinsky (2025):

  • mean_h - Mean curvature H
  • gaussian_k - Gaussian curvature K
  • unsphericity_m - Unsphericity M
  • difference_e - Difference curvature E
  • minimal_kmin - Minimal principal curvature
  • maximal_kmax - Maximal principal curvature
  • horizontal_kh - Horizontal (plan) curvature
  • vertical_kv - Vertical (profile) curvature
  • horizontal_excess_khe - Horizontal excess curvature
  • vertical_excess_kve - Vertical excess curvature
  • accumulation_ka - Accumulation curvature
  • ring_kr - Ring curvature
  • rotor - Rotor (flow-line torsion)
  • laplacian - Laplacian

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

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

surtgis-1.0.0.tar.gz (883.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

surtgis-1.0.0-cp39-abi3-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.9+Windows x86-64

surtgis-1.0.0-cp39-abi3-musllinux_1_2_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ x86-64

surtgis-1.0.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

surtgis-1.0.0-cp39-abi3-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

surtgis-1.0.0-cp39-abi3-macosx_10_12_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file surtgis-1.0.0.tar.gz.

File metadata

  • Download URL: surtgis-1.0.0.tar.gz
  • Upload date:
  • Size: 883.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for surtgis-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a1905d77a54ef53afef5abcfc39939f0474abacdb8fa1f472a5627edcfe87be5
MD5 a4666b2d9f7a02d615f9effbb77a9ebf
BLAKE2b-256 38d2019b48fabc67e23b7ae4ec2abae473ea1cd973df4c2c679bc4b5923a6690

See more details on using hashes here.

Provenance

The following attestation bundles were made for surtgis-1.0.0.tar.gz:

Publisher: python-release.yml on franciscoparrao/surtgis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file surtgis-1.0.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: surtgis-1.0.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for surtgis-1.0.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 21d933b39bcfd2600951844a58d1a819b581f3e4d0bc78308b0d7c9e3fc3f4fc
MD5 3af43dfcde0588496f685d75de5c9dfa
BLAKE2b-256 8de3e11cd4d4781239e98c3c656d617363990b53a8fb2478260f035e72e12e3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for surtgis-1.0.0-cp39-abi3-win_amd64.whl:

Publisher: python-release.yml on franciscoparrao/surtgis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file surtgis-1.0.0-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for surtgis-1.0.0-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b117a2507befebaa0ca11a39f7fad7781977f1f223dd8b52802f5b77724af116
MD5 383e0610501a27934c2ac3968673e625
BLAKE2b-256 f98add418d1b0d26edb85d820bb2cd4580bbbc8540d52e87ca2c7b6a5779390c

See more details on using hashes here.

Provenance

The following attestation bundles were made for surtgis-1.0.0-cp39-abi3-musllinux_1_2_x86_64.whl:

Publisher: python-release.yml on franciscoparrao/surtgis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file surtgis-1.0.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for surtgis-1.0.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 17faf91e8904d17de77ace07b2797a8f959c855254ca697a59c69045d51fae76
MD5 91af267612b0685087df6a787abf3aff
BLAKE2b-256 ac51ff1be5a550a80ad6cc423df8ae04a9a915cb5d98c09116b0087cada7a3ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for surtgis-1.0.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-release.yml on franciscoparrao/surtgis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file surtgis-1.0.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for surtgis-1.0.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cfe6b95cb63833c89071444f632a4d51f237951d2868957bda2db7d1d77d8c62
MD5 c458a9406230817e0cbedb2a4ddbe782
BLAKE2b-256 74e251f1995a387cbd4bbf10617a073be47dc4c79f53af56ea2fa8742283386f

See more details on using hashes here.

Provenance

The following attestation bundles were made for surtgis-1.0.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: python-release.yml on franciscoparrao/surtgis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file surtgis-1.0.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for surtgis-1.0.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b10f6cf6f9114b49ae45c85745116b320d3f09b49474641e995c8f60a5d8e990
MD5 96d1288914214924c82ba0227f7ac082
BLAKE2b-256 79475c71140abda76e625fbdd6dd2a66577955627fc1a23f80e563f53ffbb373

See more details on using hashes here.

Provenance

The following attestation bundles were made for surtgis-1.0.0-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: python-release.yml on franciscoparrao/surtgis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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