Skip to main content

Fast access to GLiM and GLHYMPS geology attributes for watersheds

Project description

pygeoglim

Fast Python package for extracting geology attributes (GLiM lithology + GLHYMPS hydrogeology) from Hugging Face datasets for any watershed or region.

🚀 Performance

  • Individual watersheds: 1-5 seconds ⚡
  • Regional analysis: 10-30 seconds
  • Large areas: 1-2 minutes
  • Direct from Hugging Face: No local downloads needed

📦 Installation

From PyPI (Recommended)

pip install pygeoglim

From GitHub

pip install git+https://github.com/galib9690/pygeoglim.git

For Development

git clone https://github.com/galib9690/pygeoglim.git
cd pygeoglim
pip install -e .

🔧 Quick Start

from pygeoglim import load_geometry, glim_attributes, glhymps_attributes

# Example 1: Using bounding box
geom = load_geometry(bbox=[-85.5, 39.5, -85.0, 40.0])

# Get GLiM lithology attributes
glim_attrs = glim_attributes(geom)
print("GLiM attributes:", glim_attrs)

# Get GLHYMPS hydrogeology attributes  
glhymps_attrs = glhymps_attributes(geom)
print("GLHYMPS attributes:", glhymps_attrs)

# Example 2: Using shapefile
geom = load_geometry(shapefile="path/to/watershed.shp")
attrs = {**glim_attributes(geom), **glhymps_attributes(geom)}

📊 Output Attributes

GLiM Lithology

  • geol_1st_class: Dominant lithology class
  • glim_1st_class_frac: Fraction of dominant class
  • geol_2nd_class: Second most common class
  • glim_2nd_class_frac: Fraction of second class
  • carbonate_rocks_frac: Fraction of carbonate rocks

GLHYMPS Hydrogeology

  • geol_permeability: Area-weighted permeability (m²)
  • geol_porosity: Area-weighted porosity (fraction)

🌍 Data Sources

  • GLiM: Global Lithological Map from Hugging Face Hub
  • GLHYMPS: Global Hydrogeology Maps from Hugging Face Hub (Parquet format)
  • Coverage: Continental United States (CONUS)

🔄 Recent Updates

  • ✅ Reverted to reliable .gpkg format for GLHYMPS data
  • ✅ Simplified data loading with direct mask-based filtering
  • ✅ Updated column mappings for actual dataset structure (logK_Ice_x, Porosity_x)
  • ✅ Streamlined error handling

📋 Requirements

  • Python >= 3.8
  • geopandas >= 0.12.0
  • shapely >= 1.8.0
  • numpy >= 1.20.0
  • pandas >= 1.3.0

🐛 Troubleshooting

If you encounter issues with GLHYMPS data loading, the package includes automatic fallback mechanisms and error reporting to help diagnose problems.

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

pygeoglim-1.0.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

pygeoglim-1.0.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pygeoglim-1.0.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.23

File hashes

Hashes for pygeoglim-1.0.0.tar.gz
Algorithm Hash digest
SHA256 18bb3ed2ae4de7c864ba178ae15ef8877990fb30c1d311ed8d785b49765479a4
MD5 a4a42cedabe76e834ca5dc86cbf5a2f8
BLAKE2b-256 036fef4acad3e198054fcee21533c125427b3d00d95f3ac05f899f037d42309b

See more details on using hashes here.

File details

Details for the file pygeoglim-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pygeoglim-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.23

File hashes

Hashes for pygeoglim-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c6b7babc3657d35c7898d188ac97040dc566e398b66d6b22631253afaef5341
MD5 d290392f895402c2fa8c026d7e6c9891
BLAKE2b-256 7c52f30d745f4e28999b52f625237d2e1c2b4e10eaf34b163e9b488c1990458d

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