Repository navigation
Conversation
Without simplification (tolerance 0) every source vertex is kept, and at low zooms long runs of them round to the same tile coordinate. Leaving out a point equal to the one before it loses nothing at tile resolution and keeps those tiles small.
This was referenced Oct 28, 2026
This branch has not been deployed
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.
With
tolerance: 0, every source vertex is kept. At low zooms, long runs of those vertices round to the same tile coordinate, so a tile holds many copies of one point.addLinenow leaves out a projected point that equals the one before it. At tile resolution that loses nothing, and the tiles kept in the index get smaller. The ring is still allocated at its exact size: the points are projected into a reused scratch buffer and then copied.We use geojson-vt with
tolerance: 0to turn nautical charts (S-57 ENC) into vector tiles, and dense coastlines made the low zooms expensive. On one chart set (17 cells, z9 to z14, 157k features):The tiles come out with the same features. With the default tolerance, few points repeat after simplification: on
us-states, 3 of 105 tiles lose a point, which is the fixture update.npm run bench routeshows no change in time or memory.In the #118 test, the expected ring drops its repeated
[0, 0]. A new test covers a dense line collapsing at z0.