Skip to content

Add GeoTIFF dataset health report and auto-rebuild stale summary index#99

Open
chourmovs wants to merge 21 commits into
Jorl17:masterfrom
chourmovs:master
Open

Add GeoTIFF dataset health report and auto-rebuild stale summary index#99
chourmovs wants to merge 21 commits into
Jorl17:masterfrom
chourmovs:master

Conversation

@chourmovs
Copy link
Copy Markdown

@chourmovs chourmovs commented May 8, 2026

Tested as is on coolify 4.0.0

  • Add a script to optionaly donwload dataset (INITIALIZE_DATASET=yes in env var)
  • Added a new dataset_health_report() method in GDALTileInterface to report:
    • .tif file count,
    • total dataset size (bytes and MB),
    • sample file list,
    • truncation flag for long lists.
  • Enhanced startup logging in server.py to print dataset health details (folder, file count, total size), plus a warning when no .tif files are found and a sample file list when files exist.
  • Added a consistency safeguard after loading summary.json:
  • if GeoTIFF files exist but indexed tiles are 0, log a warning and force create_summary_json() to rebuild the index automatically.
  • Kept the final initialization log that confirms indexed tile count after startup flow completes.

add 2 env variable

  • PORT_HOST
  • INITIALIZE_DATASET

[https://github.com/chourmovs/open-elevation]


Summary by cubic

Add a GeoTIFF dataset health check and automatically rebuild a stale summary.json index on startup. Also add an opt-in dataset initialization flow for Docker and make host port configurable.

  • New Features

    • GDALTileInterface.dataset_health_report() reports .tif count, total size (bytes/MB), and a sample file list.
    • Startup logs dataset health; warns when no .tif files are found.
    • If .tif files exist but the index has 0 tiles, force-rebuild summary.json.
    • Tile lookup uses rectangle intersection and logs matched tile/bounds; emits warnings on no match.
    • New Docker entrypoint runs /code/create-dataset.sh when INITIALIZE_DATASET=yes; docs updated.
    • docker-compose supports HOST_PORT to override the host port.
  • Dependencies

    • Pin Docker base image to osgeo/gdal:ubuntu-small-3.6.3; install libgdal-dev and gdal-bin.
    • Python deps: removed GDAL; added numpy, Pillow, Rtree (kept bottle, gunicorn, lazy).
    • Download script moves extracted SRTM TIFFs to the working directory.

Written for commit 8f2051d. Summary will update on new commits.

chourmovs added 21 commits May 8, 2026 08:50
…t-updates

Fix Dockerfile, move extracted SRTM TIFFs, and update Python requirements
…t-updates-hnhz1z

Fix GDAL Docker base tag, add GDAL deps & TZ, update requirements, and move extracted SRTM TIFFs
…docker-image

Pin GDAL base image to osgeo/gdal:ubuntu-small-3.6.3
…ocker

Remove GDAL from `requirements.txt` to avoid pip build failure
…script-if-/data-is-empty

Add Docker entrypoint to auto-initialize dataset when /code/data is empty
…script-if-/data-is-empty-hyd8t3

Add Docker entrypoint with `INITIALIZE_DATASET` control and update docs
…script-if-/data-is-empty-98scan

Add Docker entrypoint for dataset initialization; improve logging and spatial index lookup
…-tiff-files

Add GeoTIFF dataset health checks and startup logging
…-tiff-files-cgatmx

Add dataset health report and auto-rebuild stale summary on startup
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 8 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="server.py">

<violation number="1" location="server.py:10">
P1: Unvalidated `LOG_LEVEL` environment variable can crash the server at startup with a `ValueError` for unknown logging levels.</violation>
</file>

<file name="docker/Dockerfile">

<violation number="1" location="docker/Dockerfile:9">
P1: Installing Ubuntu GDAL packages on top of the OSGeo GDAL image mixes different GDAL versions (3.6.3 vs 3.4.1), which can cause ABI/runtime mismatches for the Python bindings and CLI tools.</violation>
</file>

<file name="gdal_interfaces.py">

<violation number="1" location="gdal_interfaces.py:184">
P1: Changing lookup to strict intersection can now error on coordinates outside tile coverage instead of returning the documented sea-level fallback, and overlap/border matches are selected arbitrarily.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread server.py
Comment thread docker/Dockerfile
Comment thread gdal_interfaces.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant