Make tile-join distrust source tilesets' metadata maxzoom and minzoom (#161)

* Special-case a longitude wraparound of exactly 360°

* Update version and changelog

* Make tile-join distrust source tilesets' metadata maxzoom and minzoom
This commit is contained in:
Erica Fischer
2023-11-07 14:41:05 -08:00
committed by GitHub
parent e1c665b35d
commit 2c56187530
18 changed files with 51 additions and 17 deletions
+5 -2
View File
@@ -328,10 +328,13 @@ static long long scale_geometry(struct serialization_state *sst, long long *bbox
if (geom[i].op == VT_LINETO) {
x += offset;
if (has_prev) {
if (x - prev > (1LL << 31)) {
// jumps at least 180° but not exactly 360°,
// which in some data sets is an intentional
// line across the world
if (x - prev > (1LL << 31) && x - prev != (1LL << 32)) {
offset -= 1LL << 32;
x -= 1LL << 32;
} else if (prev - x > (1LL << 31)) {
} else if (prev - x > (1LL << 31) && prev - x != (1LL << 32)) {
offset += 1LL << 32;
x += 1LL << 32;
}