[v2x] Upgrade geobuf to v3#212
Draft
greenlaw wants to merge 6 commits into
Draft
Conversation
Breaking API changes in geobuf 3.x: - geobuf.featureToGeobuf(f).toBuffer() → Buffer.from(geobuf.encode(f, new Pbf())) - geobuf.geobufToFeature(buf) → geobuf.decode(new Pbf(buf)) Added pbf ^3.3.0 as a new dependency (required by geobuf 3.x API). Updated all source files and tests to use the new API. Some tests still fail due to behavioral differences in geobuf 3.x output format (empty properties handling, numeric ID preservation). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add lib/geobuf-helpers.js with centralized encode/decode functions - normalizeFeature ensures backwards compatibility: - Adds empty properties object (geobuf 3.x omits them) - Converts numeric IDs to strings (geobuf 3.x preserves numbers) - Update all decode/encode calls to use shared helpers - Update test expectations for: - More compact encoding sizes (geobuf 3.x is ~50% smaller) - Different minzoom/maxzoom values (derived from sizes) - Changed pbf error message for corrupt data Note: getDatasetInfo() minzoom/maxzoom values will differ after upgrade due to more efficient encoding. This affects zoom recommendations only, not feature storage or retrieval. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This upgrades the geobuf dependency used by the v2x branch (which is currently still used instead of the latest v3 in some cases).
While this addresses some vulnerabilities in subdependencies, it unfortunately results in some changes to
cardboard's behavior--in particular, due to somegeobufencoding efficiency gains, minzoom/maxzoom calculations are different.I've punted for now on evaluating the downstream implications of this change, but wanted to push this up as a draft PR so we can evaluate those implications.