Trouble generating tiles for dense polygons at zoom level 24+
- Dominant language
- C++
- Stars
- 3.1k
- Forks
- 430
- PR merge metrics
- No merged PRs in 30d
Description
Well first, thanks for developping this, this is awesome for large-scale visualizations !
I have a dense polygon GeoJSON that I am trying to tile with tippecanoe. The Geojson is available [here](https://drive.google.com/file/d/10os9rl3tvxx74tBYffC8lJi3nh90axso/view?usp=sharing).
You can also see a leaflet visualization of these results [here](https://app.picterra.ch/shared_projects/0c586595-3634-4a67-9393-6288f09f854b). Note that the polygons are quite small (~5cm²) and you have to zoom to level 24 or 25 to see them well.
I tried different approach to tiling it. My first try was
```
julien@PIC-WS2:~/dev/tippecanoe (master)$ rm -rf _out && ./tippecanoe -e _out -zg --no-tile-compression --drop-densest-as-needed --extend-zooms-if-still-dropping _data/single_polygons.geojson
For layer 0, using name "single_polygons"
219212 features, 7865247 bytes of geometry, 8 bytes of separate metadata, 0 bytes of string pool
Choosing a maxzoom of -z20 for features about 1 feet (1 meters) apart
tile 20/1033201/641045 size is 621455 with detail 12, >500000
Going to try keeping the sparsest 72.41% of the features to make it fit
tile 20/1033201/641046 size is 793169 with detail 12, >500000
Going to try keeping the sparsest 56.73% of the features to make it fit
tile 20/1033201/641045 size is 518034 with detail 12, >500000
Going to try keeping the sparsest 62.90% of the features to make it fit
tile 20/1033201/641046 size is 576639 with detail 12, >500000
Going to try keeping the sparsest 44.27% of the features to make it fit
Internal error: Geometry delta is too big: 2147483648,0
```
Then I figured that it is running into limits so I tried disabling the limits:
```
rm -rf _out && ./tippecanoe -e _out -D10 -d10 -z22 --maximum-tile-bytes=10000000 --no-feature-limit --no-tile-size-limit --no-tile-compression _data/single_polygons.geojson
```
Now this gives something, but I have polygons dropped as you can see on this screenshot (blue is tippecanoe output, pink is the geojson). This is using the [QGIS Vector tiles plugin](https://github.com/geometalab/Vector-Tiles-Reader-QGIS-Plugin) for visualization, but I confirmed this by visualizing with a mapboxgl map - doesn't look like a rendering issue:

Searching through the issues, I am wondering if I am running into the fact that tippecanoe uses 32bit precision internally (https://github.com/mapbox/tippecanoe/issues/706).
So my first question is: is this expected behavior given the way maxzoom/detail works ?
If it is, I'd be interested discussing if it's realistic to try to fix this and have this work in mapboxgl as we'll have lots of use cases for visualization of small polygons on very high res drone imagery (e.g. precision agriculture, routinely with <1cm imagery).
I'd be happy to provide more details or try different approaches.
Contributor guide
Research direction
Reproduce the reported ./tippecanoe commands using the linked dense-polygon GeoJSON and compare the generated tiles at zoom levels 24 and 25. Read the related precision discussion in issue #706; done should establish whether the dropped polygons and geometry-delta error are expected limits or define a feasible, tested fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli, data
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100