Skip to main content

A Python package offering toolkits for geospatial processing, watershed delineation, and hydrologic analysis.

Project description

GeoAnalyze

Status Description
PyPI PyPI - Version PyPI - Status PyPI - Python Version PyPI - Wheel
GitHub GitHub commit activity GitHub last commit flake8 mypy pytest
Codecov codecov
Read the Docs Read the Docs
PePy Pepy Total Downloads
License GitHub License

GeoAnalyze is a Python package designed to streamline geoprocessing by handling internal complexities and intermediate steps. Conceptualized and launched on October 10, 2024, this package is tailored for users with limited geospatial processing experience, allowing them to focus on desired outputs. Leveraging open-source geospatial Python modules, GeoAnalyze aims to empower users by providing high-level geoprocessing tools with fewer lines of code. This fast package is also useful for the users who has no access of paid GIS software packages.

Wateshed Delineation

The GeoAnalyze.Watershed and GeoAnalyze.Stream classes provide fast and scalable watershed delineation functions by leveraging the computational efficiency of the PyPI package pyflwdir, without requiring a detailed understanding of it. These functions can be executed either individually or simultaneously.

Hydrology

  • Basin area extraction from an extended Digital Elevation Model (DEM)
  • DEM pit filling
  • Slope calculation
  • Slope classification
  • Aspect determination
  • Flow direction mapping
  • Flow accumulation computation
  • Stream extraction
  • Subbasin generation

The computational efficiency of these functions is demonstrated in the following output figure. All delineation files—including basin area, flow direction, flow accumulation, slope, stream, outlets, and subbasins—can be generated within 30 seconds from a raster containing 14 million cells.

All delineation files from DEM

Stream Network

  • Determines the adjacent downstream segment for each stream segment
  • Retrieves adjacent upstream segments associated with each stream segment
  • Builds full connectivity structures from upstream to downstream
  • Computes connectivity structures from downstream to upstream
  • Removes all upstream connectivity up to headwaters for targeted stream segments
  • Merges split stream segments either between two junction points or from a junction point upstream until a headwater is reached
  • Detects junctions, drainage points, main outlets, and headwaters within the stream network
  • Computes Strahler and Shreve orders of stream segments
  • Includes multiple functions for generating random boxes around selected stream segments

Geoprocessing

The GeoAnalyze package leverages the existing PyPI packages, such as, rasterio, geopandas, and shapely, to perform geoprocessing efficiently while reducing implementation complexity. Instead of requiring multiple lines of code to handle intermediate steps, the GeoAnalyze.Raster and GeoAnalyze.Shape classes streamline the process by automating these operations. Furthermore, the GeoAnalyze.Visual class assists in raster and vector data plotting and visualization. This allows users to execute geoprocessing tasks more efficiently, reducing code length while ensuring accuracy and scalability.

Raster

  • Rasterizing input geometries
  • Rescaling raster resolution
  • Transforming raster values
  • Clipping a raster using a shapefile
  • Overlaying geometries onto a raster
  • Managing Coordinate Reference System (CRS)
  • Handling NoData values in a raster
  • Generating boundary polygons from a raster
  • Reclassifying raster values
  • Trimming and extending rasters
  • Filling missing values in raster regions
  • Computing raster statistics
  • Counting unique raster values
  • Extracting raster values using a mask or range filter
  • Merging multiple raster files
  • Rewriting a raster with a different driver

Shapefile

  • Vectorizing a raster array
  • Aggregating geometries from multiple shapefiles
  • Executing spatial joins on geometries
  • Reprojecting the CRS
  • Filling polygons
  • Performing column operations on a shapefile

Visualization

  • Quick view of a raster array
  • Quick view of shapefile geometries

File Operations (Irrespective of Extensions)

When managing GIS files, each main file is often associated with several auxiliary files. For example, a shapefile is commonly accompanied by .shp, .cpg, .dbf, .prj, and .shx files, which are necessary for the shapefile to function correctly. In geoprocessing, these associated files must be handled together to prevent errors or data loss. The GeoAnalyze.File class simplifies this process by ensuring that any operation performed on a main file automatically includes its auxiliary files, making file management more efficient and error-free.

  • Deleting files in a folder.
  • Transferring files from the source folder to the destination folder.
  • Renaming files in a folder.
  • Copying files from the source folder and renames them in the destination folder.
  • Extracting files with the same extension from a folder.

Easy Installation

To install, use pip:

pip install GeoAnalyze

Quickstart

A brief example of how to start:

>>> import GeoAnalyze
>>> watershed = GeoAnalyze.Watershed()
>>> stream = GeoAnalyze.Stream()

Documentation

For detailed information, see the documentation.

Support

If this project has been helpful and you'd like to contribute to its development, consider sponsoring with a coffee! Support will help maintain, improve, and expand this open-source project, ensuring continued valuable tools for the community.

Buy Me a Coffee

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

geoanalyze-1.2.5.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

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

geoanalyze-1.2.5-py3-none-any.whl (38.2 kB view details)

Uploaded Python 3

File details

Details for the file geoanalyze-1.2.5.tar.gz.

File metadata

  • Download URL: geoanalyze-1.2.5.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.3

File hashes

Hashes for geoanalyze-1.2.5.tar.gz
Algorithm Hash digest
SHA256 f6a8f316539df7d63c977235456d7da3d1658d58eaad5d426de7779fd4bbeba2
MD5 74e2a168527988763bb99f672acb59d7
BLAKE2b-256 1570809d30da230af954e5e02502bf177a0c088d8d4d120b59a2cbae821fad98

See more details on using hashes here.

File details

Details for the file geoanalyze-1.2.5-py3-none-any.whl.

File metadata

  • Download URL: geoanalyze-1.2.5-py3-none-any.whl
  • Upload date:
  • Size: 38.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.3

File hashes

Hashes for geoanalyze-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c6b104cb3f9f6805b60d5462555b39a73a5be43505c79dda711ca4a62c637784
MD5 3bd22f11c324464f073b7446f7de8df4
BLAKE2b-256 9d209f7f38cac63dec647a8056d2dbfc3268e9b96685aac9846c9369f67f5690

See more details on using hashes here.

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