$ show ChHarding/TouchTerrain_for_CAGEO
TouchTerrain is a web application and standalone tool that converts digital elevation models (DEMs) into 3D-printable terrain models (STL/OBJ). It uses Google Earth Engine as the primary DEM source, with support for local GeoTIFF files. The architecture includes a Flask web server with a frontend using Google Maps and Three.js for preview, a standalone Python script for batch processing, and Jupyter notebooks for interactive use. The core processing pipeline fetches DEM data, resamples it, tiles it, generates mesh geometry with optional walls and bottom, and bundles the output as a ZIP file. The repository also includes geospatial utilities (coordinate conversion, KML parsing, GPX path embossing) and raster cleaning functions. While the codebase is functional and well-documented, it shows signs of technical drift: multiprocessing is broken, JavaScript libraries are outdated (Three.js r71), and there is commented-out code. The project is actively maintained with recent commits and issue triage.
The LLM identified 5 files worth highlighting for reuse:
Provides functions for converting between latitude/longitude and UTM coordinates, computing arc degrees in meters, and deriving EPSG codes from UTM zones. This is a self-contained, reusable utility for any geospatial project requiring coordinate transformations.
Implements 3D vector and point classes with operations like cross product, normalization, and subtraction. Used for computing surface normals in mesh generation. This is a clean, isolated module that can be reused in any 3D geometry or graphics project.
Parses GPX files and embosses trails onto the terrain mesh using Bresenham line drawing with configurable thickness and flat tops. This module is self-contained and demonstrates a non-obvious pattern for integrating GPS track data into 3D terrain models.
Contains utility functions for cleaning DEM rasters: diagonal NaN removal, hole filling via dilation, and array dilation. These are generic image processing operations that can be applied to any raster dataset, not just terrain data.
Core mesh generation module that converts elevation grids into 3D triangle meshes (STL/OBJ). It handles tiling, wall generation, bottom surface, and binary/ASCII STL output. The grid class encapsulates all mesh logic and can be extracted for other mesh-from-raster applications.