{"id":50369989,"url":"https://github.com/ericperret/crest","last_synced_at":"2026-05-30T06:30:31.694Z","repository":{"id":359878374,"uuid":"1247843339","full_name":"ericperret/crest","owner":"ericperret","description":"Copernicus Raster Elevation Simulation Toolkit — DSM viewer + hydrological flow simulator. Zero lib.","archived":false,"fork":false,"pushed_at":"2026-05-23T21:50:40.000Z","size":15327,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-23T23:22:39.996Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericperret.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-23T21:22:22.000Z","updated_at":"2026-05-23T21:50:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ericperret/crest","commit_stats":null,"previous_names":["ericperret/crest"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ericperret/crest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericperret%2Fcrest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericperret%2Fcrest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericperret%2Fcrest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericperret%2Fcrest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericperret","download_url":"https://codeload.github.com/ericperret/crest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericperret%2Fcrest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33682998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-30T06:30:31.038Z","updated_at":"2026-05-30T06:30:31.685Z","avatar_url":"https://github.com/ericperret.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CREST\n### Copernicus Raster Elevation Simulation Toolkit\n\n\u003e Browser-based DSM viewer and hydrological flow simulator.  \n\u003e No server. No build step. No framework. Two HTML files.\n\n---\n\n## What it does\n\n**`map.html`** — worldwide satellite map cataloguing your local Copernicus DSM tiles.  \nClick a green square to open it in the viewer.\n\n**`dsm.html`** — full DSM viewer with hydrological flow simulation.  \nRight-click anywhere on terrain to pour water. Watch it find its own path.\n\n---\n\n## Features\n\n| Feature | Detail |\n|---|---|\n| DSM rendering | GeoTIFF COG Float32, native DEFLATE decompression |\n| Colour palette | Hypsometric LUT, histogram equalisation (10 000 bins) |\n| Contour lines | 4-neighbour detection, auto interval, major/minor |\n| Flow simulation | Local flood-fill, downhill priority, canyon infiltration |\n| Water overlay | Right-click = source, Space = reset, level rises +1m when blocked |\n| Mouse overlay | Lon/lat DMS WGS84 + elevation or water depth |\n| Altitude legend | Live colour bar, water level indicator |\n| Road overlay | Leaflet + Carto labels (optional, on/off) |\n| Recording | WebM 5 fps via MediaRecorder, auto-download |\n| Tile catalogue | Scans `~/Downloads/copernicus/` — zero upload, filenames only |\n| Communication | BroadcastChannel between tabs, works on `file://` |\n\n---\n\n## Dependencies\n\n| Library | Used in | Why |\n|---|---|---|\n| [Leaflet 1.9.4](https://leafletjs.com) | both files | Satellite basemap + optional road overlay |\n\nEverything else is **vanilla JavaScript** — TIFF parsing, DEFLATE decompression (`DecompressionStream`), Float32 decoding, histogram equalisation, contour detection, flood simulation, WebM recording — all native browser APIs.\n\n---\n\n## Data source\n\nTiles come from the **Copernicus DEM GLO-30** (30 m resolution), freely available from AWS:\n\n```\nhttps://copernicus-dem-30m.s3.amazonaws.com/\nCopernicus_DSM_COG_10_{NS}{LAT}_00_{EW}{LON}_00_DEM/\nCopernicus_DSM_COG_10_{NS}{LAT}_00_{EW}{LON}_00_DEM.tif\n```\n\nExpected local structure:\n```\n~/Downloads/copernicus/\n  Copernicus_DSM_COG_10_N04_00_W053_00_DEM/\n    Copernicus_DSM_COG_10_N04_00_W053_00_DEM.tif\n  Copernicus_DSM_COG_10_S20_00_E169_00_DEM/\n    Copernicus_DSM_COG_10_S20_00_E169_00_DEM.tif\n  ...\n```\n\n---\n\n## Usage\n\n```bash\n# 1. Clone\ngit clone https://github.com/yourname/crest.git\ncd crest\n\n# 2. Open map.html in Chrome or Firefox — no server needed\n# 3. Click \"Ouvrir copernicus/\" and point to ~/Downloads/copernicus/\n# 4. Green squares appear for every tile found locally\n# 5. Click a green square — dsm.html opens and loads the tile\n```\n\n\u003e **Popup note** — Chrome may block the dsm.html popup on first use.  \n\u003e Allow popups for `file://` and click again.\n\n---\n\n## Controls\n\n### map.html\n| Action | Result |\n|---|---|\n| Click green square | Open tile in dsm.html |\n\n### dsm.html\n| Action | Result |\n|---|---|\n| Scroll wheel | Zoom (cursor-centred) |\n| Drag | Pan |\n| Right-click | Place water source |\n| Space | Reset simulation |\n| ⇄ button | Toggle hypsometry / contour lines |\n| 🗺 button | Toggle road \u0026 label overlay |\n| ⏺ REC button | Start/stop WebM recording |\n\n---\n\n## Flow simulation\n\nWater follows local terrain at each step:\n\n1. **Downhill flow** — spreads to the lowest accessible border pixel each tick\n2. **Flat terrain** — spreads to all pixels at equal minimum elevation\n3. **Basin filling** — when blocked, water level rises +1 m per tick\n4. **Canyon infiltration** — beyond 10 m of accumulated rise, penetration increases by +2 m/tick to overcome averaging artefacts in 30 m pixels\n5. **Ocean stop** — simulation halts when water reaches sea level\n\nStatus bar shows: surface elevation · accumulated rise · pixel count · active front size.\n\n---\n\n## Architecture\n\n```\ncrest/\n├── map.html          # Tile catalogue — Leaflet satellite + grid layer\n├── dsm.html          # DSM viewer + flow simulator\n└── README.md\n```\n\n**Inter-tab communication**: `BroadcastChannel('crest_dsm')`  \n`map.html` passes the `File` object directly — no re-upload, no copy.\n\n**Decompression pipeline**:\n```\n.tif → ArrayBuffer → TIFF tags → tile offsets\n     → Uint8Array(compressed) → DecompressionStream('deflate-raw')\n     → Float32 predictor decode → elevGrid + OffscreenCanvas\n```\n\n---\n\n## Browser compatibility\n\n| Browser | Minimum version |\n|---|---|\n| Chrome / Edge | 80+ |\n| Firefox | 113+ |\n| Safari | 16.4+ |\n\nRequired APIs: `DecompressionStream`, `OffscreenCanvas`, `BroadcastChannel`, `MediaRecorder`.\n\n---\n\n## Changelog\n\n| Version | Change |\n|---|---|\n| 2.0 | Replaced pako with native `DecompressionStream` — sharper output, zero dependency |\n| 1.9 | Reverted to local flood-fill (Manning removed), RAF full speed |\n| 1.8 | Altitude legend panel, RAF loop |\n| 1.7 | WebM 5 fps recording (MediaRecorder) |\n| 1.6 | Canyon infiltration (+2 m/tick beyond 10 m rise) |\n| 1.5 | Local flood-fill — water flows from adjacent wet pixel, not global level |\n| 1.4 | Water level rises +1 m when blocked, mouse shows water depth |\n| 1.3 | Flow simulation — right-click source, Space reset |\n| 1.2 | Carto overlay on/off (light_only_labels, transparent container) |\n| 1.1 | BroadcastChannel replacing postMessage (file:// compatibility) |\n| 1.0 | map.html + dsm.html, tile catalogue, hypsometry, contour lines |\n\n---\n\n## Licence\n\nMIT — see `LICENSE`.\n\n---\n\n*Built by eperret with the Help of AI Claude Sonnet 4.6 / Anthropic — May 2026*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericperret%2Fcrest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericperret%2Fcrest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericperret%2Fcrest/lists"}