mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 16:35:40 +02:00
Low zooms are OK now; medium zooms are still dropping sometimes
This commit is contained in:
@@ -609,6 +609,8 @@ void *partial_feature_worker(void *v) {
|
||||
int out_detail = (*partials)[i].extra_detail;
|
||||
|
||||
drawvec geom = (*partials)[i].geoms[0];
|
||||
drawvec before_scaling = geom;
|
||||
|
||||
to_tile_scale(geom, z, out_detail);
|
||||
|
||||
if (t == VT_POLYGON) {
|
||||
@@ -622,10 +624,19 @@ void *partial_feature_worker(void *v) {
|
||||
check_polygon(geom);
|
||||
}
|
||||
|
||||
if (geom.size() < 3) {
|
||||
if (geom.size() < 4) {
|
||||
if (area > 0) {
|
||||
// area is in world coordinates, calculated before scaling down
|
||||
geom = revive_polygon(before, area, z, out_detail);
|
||||
// Try reviving the polygon by buffering it outward a little
|
||||
|
||||
geom = buffer_poly(before_scaling, (1LL << (32 - z - out_detail)) * 1.0);
|
||||
to_tile_scale(geom, z, out_detail);
|
||||
geom = clean_or_clip_poly(geom, 0, 0, false, true);
|
||||
|
||||
if (geom.size() < 4) {
|
||||
// OK, that didn't work, make a placeholder
|
||||
// area is in world coordinates, calculated before scaling down
|
||||
geom = revive_polygon(before, area, z, out_detail);
|
||||
}
|
||||
} else {
|
||||
geom.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user