mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-06 18:35:41 +02:00
Avoid clipping if the input and output tiles are the same
This commit is contained in:
@@ -931,6 +931,7 @@ std::string overzoom(mvt_tile tile, int oz, int ox, int oy, int nz, int nx, int
|
||||
|
||||
long long tilesize = 1LL << (32 - oz); // source tile size in world coordinates
|
||||
draw ring_closure(0, 0, 0);
|
||||
bool sametile = (nz == ox && nx == ox && ny == oy);
|
||||
|
||||
for (auto const &g : feature.geometry) {
|
||||
if (g.op == mvt_closepath) {
|
||||
@@ -956,6 +957,7 @@ std::string overzoom(mvt_tile tile, int oz, int ox, int oy, int nz, int nx, int
|
||||
g.y -= ny * outtilesize;
|
||||
}
|
||||
|
||||
if (!sametile) {
|
||||
// Clip to output tile
|
||||
|
||||
long long xmin = LLONG_MAX;
|
||||
@@ -983,16 +985,22 @@ std::string overzoom(mvt_tile tile, int oz, int ox, int oy, int nz, int nx, int
|
||||
} else if (t == VT_POINT) {
|
||||
geom = clip_point(geom, nz, buffer);
|
||||
}
|
||||
}
|
||||
|
||||
// Scale to output tile extent
|
||||
|
||||
to_tile_scale(geom, nz, det);
|
||||
|
||||
if (!sametile) {
|
||||
// Clean geometries
|
||||
|
||||
geom = remove_noop(geom, t, 0);
|
||||
if (t == VT_POLYGON) {
|
||||
geom = clean_or_clip_poly(geom, 0, 0, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (t == VT_POLYGON) {
|
||||
geom = close_poly(geom);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user