coalesce-smallest-as-needed option leaving polygons in wrong place?
- Dominant language
- C++
- Stars
- 3.1k
- Forks
- 430
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I'm using Tippecanoe on a set of polygons and am running into what *might* be a bug in the `coalesce-smallest-as-needed` option. It seems to put a small number of polygons in the wrong place at lower zoom levels. Apologies if I'm misunderstanding how the feature works, and please let me know if I can do anything else to help identify/reproduce the issue.
## Details
I have a set of polygons (~100k) that represents all of the properties in a city. I'm trying to perform some simple visualization using Mapbox GL JS (all properties zoned like _this_ vs. all properties zoned like _that_).
If I run Tippecanoe with `-f -z 15 -Z 8 -l default -Bg` it turns out like [this](https://priceless-yalow-33df7e.netlify.com). Not bad, but I'd like to maintain the original area covered by the polygons even when viewing the entire city.
Next I ran Tippecanoe with `-f -z 15 -Z 8 -l default -Bg --coalesce-smallest-as-needed --maximum-tile-bytes=250000` and [this is how it turned out](https://stoic-rosalind-23887f.netlify.com). It looks much better *but* now some of the polygons are in the wrong location at lower zoom levels.
I'm using `--maximum-tile-bytes=250000` for demonstration purposes, the problem is still present with 500k tiles but a bit less obvious.
## Examples
These are all from my map at https://stoic-rosalind-23887f.netlify.com which uses [a Mapbox-hosted .mbtiles file](mapbox://gridsvancouver.28m3q6o0). I created the tiles by running Tippecanoe with `-f -z 15 -Z 8 -l default -Bg --coalesce-smallest-as-needed --maximum-tile-bytes=250000`
See the bottom left of the map at zoom level 12:

And at zoom level 13:

Note the polygon that changed from yellow to blue. If I click on that tile to get more info at zoom level 12, I can tell that 1) it's a polygon that _should_ be yellow according to its features, 2) it's definitely in the wrong place. This image shows where the yellow polygon is vs. where it should be (and _is_ located at higher zoom levels):

This occurs elsewhere in the city too:

Note the yellow tiles (surrounded by blue) which disappear as we zoom in.
Contributor guide
Research direction
Start by reproducing the reported Tippecanoe command with --coalesce-smallest-as-needed and --maximum-tile-bytes=250000, comparing the linked map at zoom levels 12–15. Check whether polygons change identity or location between zooms, then compare against the 500k-byte output; done means lower-zoom polygons remain in their correct locations and retain their expected feature properties.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, javascript
- Domain
- cli, data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100