mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 09:55:41 +02:00
Special-case a longitude wraparound of exactly 360°
This commit is contained in:
+5
-2
@@ -328,10 +328,13 @@ static long long scale_geometry(struct serialization_state *sst, long long *bbox
|
|||||||
if (geom[i].op == VT_LINETO) {
|
if (geom[i].op == VT_LINETO) {
|
||||||
x += offset;
|
x += offset;
|
||||||
if (has_prev) {
|
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;
|
offset -= 1LL << 32;
|
||||||
x -= 1LL << 32;
|
x -= 1LL << 32;
|
||||||
} else if (prev - x > (1LL << 31)) {
|
} else if (prev - x > (1LL << 31) && prev - x != (1LL << 32)) {
|
||||||
offset += 1LL << 32;
|
offset += 1LL << 32;
|
||||||
x += 1LL << 32;
|
x += 1LL << 32;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user