{"id":50696123,"url":"https://github.com/reearth/flatgeobuf-overviews","last_synced_at":"2026-06-09T06:30:53.616Z","repository":{"id":362778617,"uuid":"1260615263","full_name":"reearth/flatgeobuf-overviews","owner":"reearth","description":"FlatGeobuf Overviews (FGBO): a scale-optimized, fully fgb-compatible vector format — precomputed simplification, overview levels, and segments for fast on-demand MVT tiles from one static file. Rust encoder/decoder, CLI, tile server, and wasm browser reader.","archived":false,"fork":false,"pushed_at":"2026-06-05T21:12:58.000Z","size":281,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-05T22:21:29.413Z","etag":null,"topics":["cloud-native-geospatial","cloud-optimized","flatgeobuf","geospatial","gis","maplibre","mvt","rust","simplification","tile-server","vector-tiles","webassembly"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reearth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-06-05T17:25:09.000Z","updated_at":"2026-06-05T21:13:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/reearth/flatgeobuf-overviews","commit_stats":null,"previous_names":["reearth/flatgeobuf-overviews"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/reearth/flatgeobuf-overviews","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reearth%2Fflatgeobuf-overviews","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reearth%2Fflatgeobuf-overviews/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reearth%2Fflatgeobuf-overviews/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reearth%2Fflatgeobuf-overviews/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reearth","download_url":"https://codeload.github.com/reearth/flatgeobuf-overviews/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reearth%2Fflatgeobuf-overviews/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34095240,"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-06-09T02:00:06.510Z","response_time":63,"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":["cloud-native-geospatial","cloud-optimized","flatgeobuf","geospatial","gis","maplibre","mvt","rust","simplification","tile-server","vector-tiles","webassembly"],"created_at":"2026-06-09T06:30:52.383Z","updated_at":"2026-06-09T06:30:53.610Z","avatar_url":"https://github.com/reearth.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FlatGeobuf Overviews (FGBO)\n\nReference implementation (Rust) of a scale-optimized, FlatGeobuf-compatible\nformat.\n\nFGBO appends three kinds of sections — an **importance sidecar**,\n**overview levels**, and **segments** — after the data section of a\nFlatGeobuf (fgb) file, accelerating on-demand tile rendering at any zoom\nwhile keeping full compatibility with existing fgb readers. It is the\nvector analogue of what COG did for rasters and COPC did for point clouds.\n\n- Design document: [IDEA.md](IDEA.md)\n- Binary specification (v0): [SPEC.md](SPEC.md)\n- Compatibility verification report: [COMPAT.md](COMPAT.md)\n\n```\n┌─────────────────────────────────────────────┐\n│ plain FlatGeobuf (full resolution)          │ ← readable by any fgb reader\n├─────────────────────────────────────────────┤\n│ importance sidecar (per-vertex tolerance)   │\n│ overview levels (pre-simplified mini-fgb)   │ ← only FGBO-aware readers\n│ segments (pre-clipped large features)       │    get faster\n│ directory + footer (32B discovery at EOF)   │\n└─────────────────────────────────────────────┘\n```\n\n## Workspace layout\n\n| crate | contents |\n|---|---|\n| [`crates/fgbo`](crates/fgbo) | library: encoder, decoder, MVT tile generation (HTTP range reading behind the `http` feature; wasm-compatible core) |\n| [`crates/fgbo-cli`](crates/fgbo-cli) | `fgbo` CLI: build / info / tile / serve / convert / synth / bench — file paths or http(s) URLs |\n| [`crates/fgbo-wasm`](crates/fgbo-wasm) | browser reader: range-driven decoding + MVT rendering in wasm |\n\n## Usage\n\n```sh\n# Build an FGBO file from an fgb (input must have index + feature count)\ncargo run -rp fgbo-cli -- build input.fgb -o output.fgb\n\n# Convert GeoJSON or index-less fgb first\ncargo run -rp fgbo-cli -- convert input.geojson -o input.fgb\n\n# Inspect\ncargo run -rp fgbo-cli -- info output.fgb\n\n# Render one MVT tile (--stats prints range-read counts/bytes)\ncargo run -rp fgbo-cli -- tile output.fgb 2 3 1 --stats -o tile.mvt\n\n# Tile server + MapLibre debug page (http://127.0.0.1:8080/)\n# /compare shows fgb vs FGBO side by side with live I/O + timing stats\ncargo run -rp fgbo-cli -- serve output.fgb\n\n# Everything also works on remote files over HTTP range requests\ncargo run -rp fgbo-cli -- tile https://example.com/data.o.fgb 2 3 1 --stats\n```\n\n### Zero-server tiles in the browser (wasm)\n\n```sh\n./examples/wasm/run.sh      # browser demo: static hosting + range requests only\n```\n\n### Side-by-side comparison demo\n\n```sh\n./examples/compare/run.sh   # downloads NE 10m countries, builds, serves\n# open http://127.0.0.1:8080/compare\n```\n\n### Benchmark (synthetic buildings)\n\n```sh\n./examples/bench/run.sh     # 1M synthetic buildings, baseline vs FGBO\n```\n\nWith 1M building footprints (+17% storage, **1.7 s build** — ~40× faster\nthan baking the same data to PMTiles): **~10–12× faster tiles and ~12×\nless I/O at z10–11** via overviews, parity at z12+ where bbox queries are\nalready selective. Numbers and caveats in\n[examples/README.md](examples/README.md).\n\nTwo synced MapLibre maps render the same file through the plain-fgb\nbaseline path (left) and the FGBO path (right), with per-tile generation\ntime, bytes read, and range-read counts. With NE 10m countries: ~2× less\nI/O and ~3× faster tiles at low zoom (overviews), ~5× less I/O and ~6×\nfaster over large coastline features at z13 (segments). See\n[examples/README.md](examples/README.md).\n\nAs a library:\n\n```rust\nuse fgbo::{encode_file, render_tile, EncodeOptions, FgboReader, TileOptions};\n\n// Encode\nlet report = encode_file(\u0026input, \u0026output, \u0026EncodeOptions::default())?;\n\n// Tile generation (works on FGBO and plain fgb; plain fgb falls back to\n// on-the-fly simplification)\nlet mut reader = FgboReader::open_file(\u0026output)?;\nlet tile = render_tile(\u0026mut reader, 2, 3, 1, \u0026TileOptions::default())?;\n// tile.data = MVT bytes / reader.stats = range-read counts and bytes\n```\n\n## How it works\n\n- **importance**: at build time a modified Douglas–Peucker runs once,\n  assigning each vertex the largest tolerance it survives, as a u16\n  (geojson-vt's per-vertex significance externalized to a file).\n  Per-request simplification becomes an O(n) filter.\n- **overviews**: per zoom band (default z0–4 / z5–8 / z9–11), the\n  importance-filtered and small-feature-thinned feature set is stored as a\n  mini-fgb with its own Hilbert R-tree. Low-zoom tile requests read only\n  that section (solving low-zoom I/O).\n- **segments**: features above a vertex threshold (admin boundaries,\n  rivers, …) are pre-clipped at the z12 grid. High zooms no longer read\n  500k vertices for one tile.\n- **deterministic builds**: identical input → byte-identical output\n  (CDN caching, diff distribution, verification).\n\n## Verification status\n\n- Unit + integration tests: `cargo test` (format roundtrips, importance\n  monotonicity, clipping, all three read paths, determinism, plain-fgb\n  compatibility)\n- Compatibility measurements (Rust 6.0.1 / JS 4.4.0 / GDAL 3.12.0):\n  [COMPAT.md](COMPAT.md)\n  - Index-driven paths (bbox / HTTP range) compatible in every\n    implementation tested ✅\n  - Only the JS full-scan path \"yields all features, then errors\"\n    (the sentinel prevents misreads; upstream patch planned) ⚠️\n\n## Scope and design decisions\n\n- **2D only**: Z/M values are not supported in the extension sections\n  (MVT output has no Z; the byte-preserved body retains original values)\n- **Overview attributes**: fully copied by default; select a subset with\n  `--overview-props name,height` (or `none` for geometry-only overviews)\n  when attributes dominate section size. An ID-reference/join mode is\n  deliberately not offered — it would put full-resolution random reads\n  back into the low-zoom path\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freearth%2Fflatgeobuf-overviews","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freearth%2Fflatgeobuf-overviews","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freearth%2Fflatgeobuf-overviews/lists"}