Skip to content

Remove worldwide polygon wedges and bands - #29

Merged
Occumed79 merged 7 commits into
mainfrom
fix/polygon-merge-artifacts
Jul 28, 2026
Merged

Remove worldwide polygon wedges and bands#29
Occumed79 merged 7 commits into
mainfrom
fix/polygon-merge-artifacts

Conversation

@Occumed79

@Occumed79 Occumed79 commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Problem

Production globe screenshots show giant blue wedges, circular bands, and tile-spanning translucent polygons across North America, the Pacific, Australia, and Asia.

The root cause is the server-side MVT merger treating numeric polygon IDs as globally unique across 754 independently generated archives. Separate extracts reuse IDs for unrelated land, landcover, and depth polygons, so clipped rings were appended into one feature and encoded as giant shapes. The gateway also merged a second basemap land layer on top of the authoritative physical surface.

Repair

  • polygon features are deduplicated only by exact geometry, never merged by reused numeric ID;
  • line features still merge across shard boundaries by OSM ID;
  • overscaled surface polygons are clipped to the requested child tile before encoding;
  • the physical surface is the single authoritative land mask, with duplicate basemap land excluded;
  • unit guards reproduce reused-ID polygon corruption and reject geometry escaping the tile extent;
  • a candidate overview archive is rebuilt from all 754 shards using the corrected merger;
  • dedicated globe renders cover North America, the central Pacific, Australia, Asia-Pacific, Africa/Europe, and a wider world view.

Release requirement

The existing published occumed-world-overview.pmtiles contains geometry generated by the old merger. After the rebuilt-overview artifact is visually approved, the corrected overview asset must be uploaded with --clobber before production can be considered repaired.

Merge rule

Keep this PR draft and unmerged until the rebuilt candidate screenshots show no wedges, bands, giant circles, blank areas, or source switching.

Summary by CodeRabbit

  • Bug Fixes

    • Improved worldwide map rendering by preventing duplicate land features and incorrectly merged polygon shapes.
    • Improved tile scaling so polygon boundaries remain within their intended map areas.
    • Added fallback handling when worldwide surface data is unavailable.
    • Added support for using a locally rebuilt worldwide overview during validation.
  • Tests

    • Added automated visual and geometry checks across multiple globe views.
    • Expanded validation for polygon merging, land coverage, tile bounds, and worldwide overview assets.
    • Validation results now include screenshots, diagnostics, logs, and rebuilt map assets.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Occumed79 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 550c31ab-8f6f-452a-b025-ccdcbed14d97

📥 Commits

Reviewing files that changed from the base of the PR and between 2839379 and ddd338d.

📒 Files selected for processing (6)
  • .github/workflows/validate-continuous-zoom.yml
  • .github/workflows/validate-polygon-artifacts.yml
  • scripts/capture-polygon-regression.mjs
  • scripts/check-world-tile-gateway.mjs
  • src/server/mvt.js
  • src/server/world-tile-gateway.js

📝 Walkthrough

Walkthrough

The PR updates MVT polygon merging and overscaling, adds worldwide overview URL overrides and land-layer handling, and introduces CI workflows that rebuild PMTiles assets and run Playwright polygon regression captures.

Changes

Worldwide polygon validation

Layer / File(s) Summary
Polygon merging and overscaling
src/server/mvt.js
Polygon deduplication now uses exact geometry, excludeLayers is supported, overscaled polygons are clipped to child bounds, and layer bounds are reported.
Gateway asset and layer resolution
src/server/world-tile-gateway.js, scripts/check-world-tile-gateway.mjs
The gateway supports a local overview URL, excludes duplicate basemap land when appropriate, and validates polygon merging, overscaling, and layer composition.
Rebuilt overview asset workflows
.github/workflows/validate-*.yml
CI rebuilds and validates corrected overview and land-surface PMTiles assets, runs local servers, and uploads generated artifacts.
Browser polygon regression capture
scripts/capture-polygon-regression.mjs
Playwright renders configured views, validates vector sources and feature counts, captures screenshots, and writes a regression report.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

Possibly related PRs

  • Occumed79/Map#26 — Shares the WorldTileGateway overview URL and MVT merging paths.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/polygon-merge-artifacts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Occumed79 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@Occumed79
Occumed79 marked this pull request as ready for review July 28, 2026 00:00
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Occumed79 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@Occumed79
Occumed79 merged commit 1be1ccf into main Jul 28, 2026
3 of 7 checks passed
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