Skip to content

Differential GeoJSON-VT#188

Closed
wayofthefuture wants to merge 5 commits intomapbox:mainfrom
wayofthefuture:differential-vt
Closed

Differential GeoJSON-VT#188
wayofthefuture wants to merge 5 commits intomapbox:mainfrom
wayofthefuture:differential-vt

Conversation

@wayofthefuture
Copy link

@wayofthefuture wayofthefuture commented Oct 29, 2025

This PR introduces differential update support to GeoJSON-VT, enabling incremental updates to existing source data without requiring a full tile-stack regeneration. This significantly improves performance when only a subset of features have changed, since tiles unaffected by the update can be retained.

The update workflow removes only the tiles impacted by the modified feature set, then defers to the standard getTile generation path to rebuild those tiles as needed. This also reduces the overhead associated with repeatedly simplifying the entire dataset.

This PR attempts to not touch or affect current/core functionality of this package. The updateable option must be set in the constructor for the code to take effect. There are also a couple of added utility functions to merge differential updates that are currently not in use but may be useful in the case of high-frequency asynchronous updates.

Note: @mourner This is currently a draft PR. I am still validating correctness and performance and would appreciate feedback on the approach and implementation details before requesting a full review.

Benchmark comparisons between the existing workflow and the new incremental update process are included below.

Starting geojson-vt benchmark - constructor vs updateData:

100 Initial, 1 changing, getTile z=20:
  - updateData: 134% faster

100 Initial, 10 changing, getTile z=20:
  - updateData: 124% faster

100 Initial, 100 changing, getTile z=20:
  - constructor: 1% faster

10,000 Initial, 1 changing, getTile z=20:
  - updateData: 994% faster

10,000 Initial, 100 changing, getTile z=20:
  - updateData: 875% faster

10,000 Initial, 1,000 changing, getTile z=20:
  - updateData: 521% faster

100,000 Initial, 1 changing, getTile z=20:
  - updateData: 423% faster

100,000 Initial, 100 changing, getTile z=20:
  - updateData: 601% faster

100,000 Initial, 1,000 changing, getTile z=20:
  - updateData: 519% faster

diff.mov

@wayofthefuture
Copy link
Author

I removed the extraneous merging utilities to decrease the size of the PR.

@mourner mourner self-requested a review November 14, 2025 18:25
@mourner
Copy link
Member

mourner commented Nov 14, 2025

Hey @wayofthefuture, thanks so much for the thoughtful work on this — definitely going to review carefully. And sorry for a late response — somehow I only noticed the PR now when I've been pointed to it, had some crazy weeks recently...

@wayofthefuture
Copy link
Author

Thanks for the message! I figured you were very busy your reputation precedes you! Thanks for your time. I did my best to make this updateable and it was done carefully, so hopefully I didn't make any major mistakes. While it might not improve performance in all situations, it was doing quite well with my tests so hopefully it will be an improvement. Please let me know if you think anything needs to be changed.

@wayofthefuture wayofthefuture marked this pull request as draft November 15, 2025 00:36
@wayofthefuture wayofthefuture marked this pull request as ready for review November 20, 2025 22:19
@wayofthefuture
Copy link
Author

@mourner Okay hopefully this is good! Had to finish invalidation within the buffer edges but all appears to be working as planned...

@wayofthefuture wayofthefuture closed this by deleting the head repository Jan 16, 2026
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.

2 participants