$ show nasa-gibs/onearth
OnEarth is NASA GIBS's geospatial tile serving system designed to deploy OGC-compliant web services (WMTS, WMS, TWMS) for raster and vector earth observation imagery. It is a hybrid system that functions primarily as a production-grade applicationβcomposed of Dockerized microservices (tile, time, capabilities, reprojection, WMS, demo) backed by Apache HTTPD with custom C modules (mod_mrf, mod_brunsli, mod_convert, mod_twms, mod_wmts_wrapper, etc.) for high-performance tile serving and format transformation. The system also includes substantial data-processing tooling for generating Meta Raster Format (MRF) tiles from georeferenced images, creating vector tiles, managing colormaps, and synchronizing data from S3. The architecture is modular and configurable via YAML endpoint/layer definitions, with temporal layer support managed through Redis and a Python time service. While the codebase shows signs of organic growth over many yearsβsome duplicate utilities and hardcoded pathsβit contains well-crafted isolated components that could be extracted for reuse in other geospatial or web-serving contexts.
The LLM identified 3 files worth highlighting for reuse:
An Apache HTTPD module that adds on-the-fly Brunsli (lossless JPEG recompression) encoding/decoding support. It implements the standard Apache module hooks (register_hooks, handler) and manages a 1 MB input buffer for decode operations. The code is self-contained, with clearly defined configuration directives and minimal dependencies on internal OnEarth modules, making it extractable for any Apache-based service needing Brunsli encoding/decoding.
A WSGI application that serves temporal metadata for WMTS layers. It accepts requests for time dimensions (dates, periods, best-available layer) and responds with JSON, using Redis sorted sets and hashes for storage. The handler factory pattern and clear separation of query logic from HTTP handling make it reusable as a lightweight temporal service for any time-enabled map service.
A Python script that synchronizes configuration files from an S3 bucket to a local directory with checksum verification, dry-run support, and concurrent threading controlled by a semaphore. It implements idempotent download logic, handles deletion of stale files, and reports success/failure counts. The pattern of checksum-based sync with thread pool is general enough to be reused in any project needing reliable S3-to-local downloads.