mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-03-31 16:00:36 +00:00
Clipping is faster with only one duplicate/shifted geometry copy
This commit is contained in:
parent
dace304182
commit
256139b385
14
tile.cc
14
tile.cc
@ -550,11 +550,17 @@ long long write_tile(char **geoms, char *metabase, char *stringpool, int z, unsi
|
||||
// shifted by 360 degrees, and then make sure both copies get clipped down to size.
|
||||
|
||||
unsigned n = geom.size();
|
||||
for (unsigned i = 0; i < n; i++) {
|
||||
geom.push_back(draw(geom[i].op, geom[i].x - (1LL << 32), geom[i].y));
|
||||
|
||||
if (bbox[0] < 0) {
|
||||
for (unsigned i = 0; i < n; i++) {
|
||||
geom.push_back(draw(geom[i].op, geom[i].x + (1LL << 32), geom[i].y));
|
||||
}
|
||||
}
|
||||
for (unsigned i = 0; i < n; i++) {
|
||||
geom.push_back(draw(geom[i].op, geom[i].x + (1LL << 32), geom[i].y));
|
||||
|
||||
if (bbox[2] > 1LL << 32) {
|
||||
for (unsigned i = 0; i < n; i++) {
|
||||
geom.push_back(draw(geom[i].op, geom[i].x - (1LL << 32), geom[i].y));
|
||||
}
|
||||
}
|
||||
|
||||
bbox[0] = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user