Skip to main content

Geoterminal is a command-line tool designed to simplify common GIS tasks that you may encounter in your daily work.

Project description

Geoterminal

PyPI version License: MIT Python 3.10+

Geoterminal is a powerful Python library and command-line tool designed to streamline geospatial data processing and H3 grid operations. It provides an intuitive interface for common GIS operations, supporting multiple file formats and offering both a Python API and CLI for maximum flexibility.

Features

  • Flexible Input/Output

    • Support for GeoJSON, Shapefile, CSV, ORC, and WKT formats
    • Direct WKT string input for quick operations
    • Automatic format detection and conversion
  • Geometry Operations

    • Buffer creation with customizable distance
    • Geometry clipping with file or WKT mask
    • CRS transformation and validation
  • H3 Integration

    • Convert geometries to H3 cells
    • Configurable resolution (0-15)
    • Optional geometry inclusion
    • Efficient spatial indexing
  • Developer-Friendly

    • Clean Python API
    • Comprehensive CLI
    • Extensive documentation
    • Type hints and error handling

Quick Start

Installation

# Install from PyPI
pip install geoterminal

For development, we use Poetry. First install Poetry if you haven't already:

curl -sSL https://install.python-poetry.org | python3 -

Then clone and install the project:

# Clone the repository
git clone https://github.com/jeronimoluza/geoterminal.git
cd geoterminal

# Install dependencies and create virtual environment
poetry install

# Install with development dependencies
poetry install --with dev

# Install with documentation dependencies
poetry install --with docs

# Activate the virtual environment
poetry shell

Usage

Basic Usage

Geoterminal accepts both file paths and WKT strings as input:

# Convert between different formats
geoterminal input.shp output.geojson
geoterminal input.geojson output.csv
geoterminal input.csv output.orc

# Generate from WKT string
geoterminal "POLYGON((30 10, 40 40, 20 40, 10 20, 30 10))" output.geojson

# Work with CSV/ORC files using custom geometry columns
geoterminal input.csv output.geojson --geometry-column my_wkt_column
geoterminal input.orc output.shp --geometry-column my_wkt_column

Processing Options

You can combine multiple processing options:

# Apply a buffer and convert to H3 cells
geoterminal input.shp output.geojson --buffer-size 1000 --h3-res 6

# Convert WKT to H3 cells with geometries
geoterminal "POLYGON((30 10, 40 40, 20 40, 10 20, 30 10))" output.geojson --h3-res 6 --h3-geom

# Reproject data
geoterminal input.shp output.csv --input-crs 4326 --output-crs 3857

Additional Commands

# View first 10 rows of a file
geoterminal head -n 10 input.geojson

# View last 8 rows of a file
geoterminal tail -n 8 input.geojson

# Clip geometries using a mask file
geoterminal clip input.shp mask.geojson output.geojson

# Clip using WKT string as mask
geoterminal clip input.shp "POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))" output.geojson

Python API

from geoterminal.geometry_operations import GeometryProcessor
from geoterminal.h3_operations import H3Processor
from geoterminal.file_io import read_geometry_file

# Read data
gdf = read_geometry_file("input.geojson")

# Geometry operations
processor = GeometryProcessor(gdf)
buffered = processor.apply_buffer(distance=1000)

# H3 operations
h3_processor = H3Processor(gdf)
h3_cells = h3_processor.polyfill(resolution=6)

# Export
h3_cells.to_file("output.geojson")

Documentation

Comprehensive documentation is available:

Contributing

Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

geoterminal-0.1.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

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

geoterminal-0.1.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file geoterminal-0.1.0.tar.gz.

File metadata

  • Download URL: geoterminal-0.1.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.2 Darwin/24.3.0

File hashes

Hashes for geoterminal-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1ef3528537feeaa71d57ff39ae8f35f160d2c300604f513db4aeab11052e4d04
MD5 44c0ff2f90c0f8f9ace0ed8701a30e7f
BLAKE2b-256 91d33585ec16441ec123ed0f52d6d720942d80af0a95a15a0af9ee878334f25e

See more details on using hashes here.

File details

Details for the file geoterminal-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: geoterminal-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.2 Darwin/24.3.0

File hashes

Hashes for geoterminal-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91c85ee9f67549d7905a98c5ee21d0aa6eaae0ae5e6ab3e9030905bff7c12142
MD5 6b9d1368dc6975e13c49657d943ec7d0
BLAKE2b-256 19f3a56c93d86029f6cf0698698d19decbb2eadbde1e3e008a1f62a8210f6854

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