Look up shared nodes once per vertex instead of once per tile

With --no-simplification-of-shared-nodes, simplify_lines() used to offset
every vertex of every feature to world coordinates and check it against
the Bloom filter and the global sorted list of shared nodes, in every
tile at every zoom level.

Whether a vertex is a shared node depends only on its world coordinates,
so now it is found once, after the list of shared nodes has been made
and before the geometry is sorted, by a parallel pass over each reader's
geometry that marks each vertex in place, in the upper bits of its
serialized operation byte. Decoding puts that state into a new field of
draw (which still fits in 16 bytes), and it is carried through clipping,
the copies across the antimeridian at z0, and the geometry written for
the next zoom level. Polygon cleaning of coalesced features restores the
state of any output vertex with the same coordinates as an input vertex.

Vertices whose state is still unknown, because they were created by
clipping or polygon cleaning or came back from a prefilter, are still
looked up in the global list when they are simplified, so the output is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P2nBqZisxNQfmEmon3vE9v
This commit is contained in:
Claude
2026-09-23 17:39:48 +00:00
parent 4f2621186a
commit d3a98170bf
11 changed files with 750 additions and 52 deletions
+11
View File
@@ -1,3 +1,14 @@
# 2.83.0
* Speed up `--no-simplification-of-shared-nodes` by checking each vertex
against the global list of shared nodes only once, before tiling begins,
instead of again in every tile at every zoom level. Each vertex now carries
whether it is a shared node, in the upper bits of its serialized operation
byte and in a new field of `draw`, through clipping and into the geometry
for the next zoom level. Only vertices that are created during tiling,
by clipping or by polygon cleaning, or that come back from a prefilter,
still need to be looked up. Output is unchanged.
# 2.82.0
* Fix corruption of a JSON array when a non-final element was removed from it.