Skip to content

Larger map packs B: the tile Worker and TrailView read public grid format 4 #3073

Closed

Description

@timohueser

Status: approved
Part of #3069. The pack rule, its reasons and the formats are in #3069.

TL;DR

Goal: The tile Worker and the TrailView terrain reader find the pack of a tile by the pack rule of #3069 when a release has public grid format 4, and they keep reading public grid format 3.
Systems: planner-tile-server, trailview
Contracts: none (the specs change in the bake sub-issue)
Size: M (2 systems)

Plan

  1. planner/tiles/src/grid.mjs: GRIDS = [3, 4]. gridConfig accepts public grid format 4, {format: 4}, without map_zoom. Add packPointer(bucket, prefix, name, tile): for public grid format 4, read the block index of the tile's base square once, then check the names from the tile zoom back to the base level and return the first pointer, or null. For public grid format 3, keep today's packName path.
  2. planner/tiles/src/worker.mjs: use packPointer.
  3. builder/web/src/lib/trailview/stream/terrain.ts: when the public grid it reads has format 4, find the z13 pack with the same rule in the block index public/maps/tiles/terrain/13/7-…json of the base square. Cache the result per base square. Public grid format 3 keeps today's path.
  4. Tests: planner/tiles/test/worker.test.mjs: a tile in a split square reads its child pack; a tile at the zoom of a split pack reads the parent; a cold tile reads one block index; a warm read is still one R2 read per tile. terrain.test.ts: the same rule for public grid format 4.

Done when

  • The suites that obc test affected --base origin/develop selects pass.
  • The Worker reports grids [3, 4] at /version after deploy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions