Skip to content

matthew-lottly/GeoScriptHub

Repository files navigation

GeoScriptHub

A collection of open-source GIS tools built for analysts, developers, and the community.

Python 3.11+ TypeScript License: MIT PRs Welcome


Table of Contents


About

GeoScriptHub is a monorepo of production-quality geospatial tools and interactive web widgets. Every tool is written with:

  • Full OOP — each Python tool inherits from a shared GeoTool abstract base class.
  • Clean architecture — Template Method pattern, Strategy pattern, and a custom exception hierarchy keep code maintainable.
  • Google-style docstrings on every class, method, and module.
  • Click-based CLIs — all Python tools run from the command line with --help support.
  • TypeScript web widgets built with Vite, typed end-to-end, and embeddable via <script> tag or npm import.

Whether you need to batch-reproject 10,000 coordinates, validate a shapefile before a data pipeline, or drop a before/after map swiper into a web page — there's a tool here for you.


Tool Index

Python CLI Tools

# Tool Description Docs
1 Batch Coordinate Transformer Reproject CSV/GeoJSON coordinates between any two CRS using pyproj → README
2 Shapefile Health Checker Validate shapefiles & GeoJSON for null geometries, bad CRS, duplicates & more → README
3 Batch Geocoder Convert a CSV of addresses to GeoJSON points via Nominatim or Google → README
4 Raster Band Stats Reporter Per-band statistics (min/max/mean/std dev) for any GeoTIFF → README
5 Spectral Index Calculator Compute NDVI, NDWI, EVI, SAVI from Landsat 8/9 or Sentinel-2 bands → README
6 OSM Change Monitor Poll OpenStreetMap Overpass API for changes within a bounding box → README
7 FGDB Archive Publisher Backup portal data to FGDB, clean schemas, validate topology, and republish (arcpy) → README

TypeScript Web Widgets

# Widget Description Docs
8 Proximity Ring Analyzer ExB widget — click the map, draw buffer rings, query nearby features per layer → README
9 Leaflet Widget Generator Paste GeoJSON → get a self-contained embeddable Leaflet HTML snippet → README
10 Map Swiper Before/after swipe comparison of two map layers (MapLibre GL JS) → README
11 GeoJSON Diff Viewer Visual "git diff" for two GeoJSON files — added/removed/changed features → README

Google Earth Engine Scripts

# Script Description Docs
12 NDWI Flood-Frequency Mapper Sentinel-2 time series → NDWI → water classification → flood-frequency raster (Mississippi Delta) → README
13 Sub-Canopy Structure Detector Sentinel-1 SAR + Sentinel-2 optical fusion — five-indicator pipeline to locate buildings hidden beneath forest canopy → README

Repository Structure

GeoScriptHub/
├── .github/
│   └── ISSUE_TEMPLATE/
│       └── bug_report.md
│
├── shared/
│   └── python/
│       ├── __init__.py          # Re-exports for clean imports
│       ├── base_tool.py         # GeoTool ABC — all Python tools inherit this
│       ├── exceptions.py        # Custom exception hierarchy
│       └── validators.py        # Shared precondition checks
│
├── tools/
│   ├── python/
│   │   ├── batch-coordinate-transformer/
│   │   ├── shapefile-health-checker/
│   │   ├── batch-geocoder/
│   │   ├── raster-band-stats/
│   │   ├── spectral-index-calculator/
│   │   ├── osm-change-monitor/
│   │   └── fgdb-archive-publisher/
│   └── typescript/
│       ├── proximity-ring-analyzer/
│       ├── leaflet-widget-generator/
│       ├── map-swiper/
│       └── geojson-diff-viewer/
│   └── gee/
│       ├── ndwi-flood-frequency/
│       └── sub-canopy-structure-detector/
│
├── .gitignore
├── LICENSE
└── README.md                    ← you are here

Getting Started

Python Tools — Quick Setup

Each Python tool is self-contained with its own pyproject.toml. Install and run any tool individually:

# 1. Clone the repository
git clone https://github.com/matthew-lottly/GeoScriptHub.git
cd GeoScriptHub

# 2. Create a virtual environment (Python 3.11+ required)
python -m venv .venv
# Windows:
.venv\Scripts\activate
# macOS / Linux:
source .venv/bin/activate

# 3. Install a specific tool (example: Batch Coordinate Transformer)
cd tools/python/batch-coordinate-transformer
pip install -e .

# 4. Run it
geo-transform --help

TypeScript Widgets — Quick Setup

# Requires Node.js 18+ and pnpm (npm install -g pnpm)
cd tools/typescript/leaflet-widget-generator

# Install dependencies
pnpm install

# Start the local dev server
pnpm dev

# Build for production (outputs to dist/)
pnpm build

GEE Scripts — Quick Start

Google Earth Engine scripts run in the browser — no local install needed.

  1. Open the GEE Code Editor.
  2. Create a new script and paste the contents from the tools/gee/ folder.
  3. Adjust the user parameters at the top of the file.
  4. Click Run.

Shared Python Foundation

All Python tools share a common foundation in shared/python/:

Module Purpose
base_tool.py GeoTool abstract base class with Template Method run() pipeline
exceptions.py GeoScriptHubError root + typed subclasses per failure domain
validators.py Static precondition helpers (assert_file_exists, assert_crs_valid, etc.)

To use the shared modules while developing a tool locally, add the repo root to PYTHONPATH:

# From the repo root
# Windows:
set PYTHONPATH=.
# macOS / Linux:
export PYTHONPATH=.

Contributing

Contributions are welcome! Please read CONTRIBUTING.md before opening a pull request.

  1. Fork this repository.
  2. Create a feature branch: git checkout -b feature/my-new-tool.
  3. Commit your changes: git commit -m "feat: add my new tool".
  4. Push to your fork: git push origin feature/my-new-tool.
  5. Open a Pull Request against main.

Customization Guide

Each tool README includes a configuration reference table. Common values you may want to change:

Setting Where it appears Notes
EPSG codes Tool READMEs, code examples Use the EPSG code for your data's CRS
Slack webhook URL OSM Change Monitor Your Slack incoming webhook URL
Google API key Batch Geocoder Your Google Maps Geocoding API key

License

Distributed under the MIT License. See LICENSE for full text.


Contact

Author: matthew-lottly
GitHub: github.com/matthew-lottly


Built with Python 🐍 and TypeScript 🔷 — Made for the GIS community.

About

A public library of GIS programming tools organized by automation, widgets, applications, and spatial analysis. Includes Python scripts, JavaScript widgets, and spatial workflows for ArcGIS and open-source platforms—built for practical, real-world geospatial solutions.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors