Skip to main content

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

Metadata

Release files for surtgis 1.5.0

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

Source distribution (sdist)

Source distribution for surtgis 1.5.0
File Size Uploaded Provenance Actions
surtgis-1.5.0.tar.gz 1.1 MB With provenance Details for surtgis-1.5.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for surtgis 1.5.0
File Actions
surtgis-1.5.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for surtgis-1.5.0-cp39-abi3-win_amd64.whl
surtgis-1.5.0-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details for surtgis-1.5.0-cp39-abi3-musllinux_1_2_x86_64.whl
surtgis-1.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for surtgis-1.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
surtgis-1.5.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for surtgis-1.5.0-cp39-abi3-macosx_11_0_arm64.whl
surtgis-1.5.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for surtgis-1.5.0-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 17.5 MB

Release files / surtgis-1.5.0.tar.gz

Download URL surtgis-1.5.0.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
223a2a7fff32186b789e36e011bc22d8a400bf2d26083d1910240964bf4f07e6
BLAKE2b-256 checksum
How to use checksums
cf84907e5e482e1a2ebd1ac27741e8c8f59b013f8de4d3b76db4dd5b11ecdc12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / surtgis-1.5.0-cp39-abi3-win_amd64.whl

Download URL surtgis-1.5.0-cp39-abi3-win_amd64.whl
Size 3.3 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
4c4ec856615aea06fbd545c6eb40f6af82a078aac1c3460242966e5fdae84637
BLAKE2b-256 checksum
How to use checksums
659b917eb88ed671c1caf0b10dc43f748afdba0f69cab57d621b7c74ecfedc0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / surtgis-1.5.0-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL surtgis-1.5.0-cp39-abi3-musllinux_1_2_x86_64.whl
Size 3.5 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
8d46cafd7f1a0fdcdf3211b5d89f5343cd91c259289f97675e1830e8c64105de
BLAKE2b-256 checksum
How to use checksums
efe37b15a8bd4f81c394a290c7f75a8515c0f905fe5c9c938a447f0f65c07159
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / surtgis-1.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL surtgis-1.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.3 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
9f05b750f0edd3b1a036af956d0cf63bbe9d9900e2f72e743942695324d9de55
BLAKE2b-256 checksum
How to use checksums
a9f0d37d098d2445c30ee8f85a107dcf73bda7ed8fa8b151528ab7f919adbcd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / surtgis-1.5.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL surtgis-1.5.0-cp39-abi3-macosx_11_0_arm64.whl
Size 3.0 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4855a9484ba8f8cf9c9d68b9e4eca1dd1c68eda1e084c945e894b5cb3d9b44a9
BLAKE2b-256 checksum
How to use checksums
3d9937ce96e669a78e7c5bf2c1f01103a0288966c9a707924723d188a847105a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / surtgis-1.5.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL surtgis-1.5.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 3.2 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
d0591e7a84d6602dce19cb7886171c9fddfb43e4c468914900e64eb0125213d4
BLAKE2b-256 checksum
How to use checksums
3602708f5ae0a6a21d2108776540b8d0fed5a3c94204448134c1379ce150d35d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Security for surtgis 1.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for surtgis-1.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.5.0 This release

6 release files Full provenance

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