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 command-line tool designed to simplify common GIS tasks that you may encounter in your daily work.

Features

  • File format conversion (GeoJSON, Shapefile, CSV, ORC)
  • Geometry operations (buffer, clip)
  • H3 integration (polyfill)
  • CRS transformations
  • Inspect mode for quick data viewing
  • Operation order preservation and offering both a Python API and CLI for maximum flexibility.

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 -

Or if you have Homebrew installed, you can do:

brew install poetry

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

# Activate the virtual environment
poetry shell

Usage

Basic Usage

GeoTerminal accepts both file paths and WKT strings as input. The input and output file formats are automatically detected based on their extensions.

# Inspect data (show first 10 rows)
geoterminal input.shp --head 10

# Show CRS information
geoterminal input.shp --crs

# Convert formats
geoterminal input.shp output.geojson

# Operations are applied in the order specified
geoterminal input.shp output.geojson --buffer-size 1000 --h3-res 7  # Buffer first, then H3
geoterminal input.shp output.geojson --h3-res 7 --buffer-size 1000  # H3 first, then buffer

# Set log level for detailed output
geoterminal input.shp output.geojson --buffer-size 1000 --log-level DEBUG

Processing Options

You can combine multiple processing options with your conversion commands:

# Apply a buffer of 1000 meters 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

# Clip geometries using a mask file
geoterminal input.shp output.geojson --mask mask.geojson --mask-crs 4326

# Clip geometries using a mask WKT
geoterminal input.shp output.geojson --mask "POLYGON((30 10, 40 40, 20 40, 10 20, 30 10))"

File Inspection

View the contents of your files using the head and tail commands:

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

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

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.2.tar.gz (10.5 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.2-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: geoterminal-0.1.2.tar.gz
  • Upload date:
  • Size: 10.5 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.2.tar.gz
Algorithm Hash digest
SHA256 9b6f0f8b97b09d885f035b4263ff7cd47659eb8b781135086517b2d0d5a0d77d
MD5 a584a1e2acdef2fa94608885918f6b2a
BLAKE2b-256 ec9a83825f4a75a40119c84cce8dc8355067991ad3d81076296f293c0a967860

See more details on using hashes here.

File details

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

File metadata

  • Download URL: geoterminal-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 13.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f595d75ac3884631472747e418e7aa1385fba43a6642b959c2373905a9567aca
MD5 97ca8cfa2ef414eb28f44481cd2798cf
BLAKE2b-256 3488469f95b794c16cd178c4cc412af1f26da7f325620bc695bd3839b2d02e50

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