Skip to main content

Geospatial processing library based on GDAL and Google Earth Engine

Project description

GeoSpace

A Python library for geospatial processing based on GDAL.

GeoSpace is a powerful and efficient Python library designed to simplify geospatial data processing. It provides a comprehensive set of tools for working with raster and vector data, leveraging the capabilities of GDAL.

Installation

You can install GeoSpace using pip:

pip install geospace -U

Features

High-Performance Zonal Statistics

GeoSpace excels at performing zonal statistics, offering highly optimized functions for calculating statistics of raster values within polygons.

  • Area-Weighted Averaging: The basin_average function calculates the area-weighted average of raster values for each polygon in a shapefile. It is optimized for memory efficiency and parallel processing, making it suitable for large datasets and high-performance computing environments, including Slurm clusters.

basin_average Example

Here's an example of how to use the basin_average function to calculate the average precipitation and temperature for a set of basins:

import geospace as gs

# Paths to your rasters and shapefile
rasters = ['path/to/P.tif', 'path/to/T.tif']
basins_shp = 'path/to/basins.shp'

# Calculate the average values for each basin
df_stats = gs.basin_average(rasters, basins_shp)

# Rasters as rows and basins as columns
print(df_stats)

Raster Processing

  • Reprojection: Easily reproject rasters to different coordinate systems.
  • Resampling: Resample rasters to new resolutions using various algorithms.
  • Mosaicking: Combine multiple rasters into a single mosaic.
  • Clipping: Clip rasters to the extent of a shapefile.
  • Nodata Filling: Fill nodata values in rasters using various interpolation methods.
  • Data Type Conversion: Convert rasters to different data types (e.g., UInt8).
  • GRIB to GeoTIFF: Convert GRIB files to GeoTIFF format.

Vector Processing

  • Buffering: Create buffers around vector features.
  • Reprojection: Reproject shapefiles to different coordinate systems.
  • Filtering: Filter shapefiles based on attribute queries.
  • Polygonization: Convert rasters to polygon shapefiles.
  • Rasterization: Convert shapefiles to raster datasets.

Google Earth Engine Integration

  • Data Export: Export Google Earth Engine images to GeoTIFF or CSV format.
  • SoilGrids: Download and preprocess SoilGrids data.
  • Wind Data: Calculate wind speed from u and v components.
  • Time Series Analysis: Group image collections by month and calculate seasonality indices.

Utilities

  • Coordinate Conversion: Convert between geographic and image coordinates.
  • Spatial Calculations: Calculate grid cell areas and distances.
  • File Handling: Manage file paths and avoid name collisions.

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

geospace-0.5.3.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

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

geospace-0.5.3-py3-none-any.whl (35.2 kB view details)

Uploaded Python 3

File details

Details for the file geospace-0.5.3.tar.gz.

File metadata

  • Download URL: geospace-0.5.3.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for geospace-0.5.3.tar.gz
Algorithm Hash digest
SHA256 d8b5d0ec80385648e8e256dcb5e58f9686ba57de4288a21393b699ed2b33a8e4
MD5 09d56ad0c4761bdf6679fff35ba3bdbb
BLAKE2b-256 aabebaec122854893aaa3a0ee3642a6594ebc96a1c0a28c90ad1c9da176b7211

See more details on using hashes here.

File details

Details for the file geospace-0.5.3-py3-none-any.whl.

File metadata

  • Download URL: geospace-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 35.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for geospace-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9b34e35eb6cf5f771bae5db0cedd42cf56f74c5016111b5318950c01e947ea9b
MD5 3d7e0173bb8a686012aad51c658dfc13
BLAKE2b-256 d82078e3ab53de67d4a6d85cb110c90512efd2ee3acb61d9afdea6c822b7a465

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