Skip to content

Commit

Permalink
Merge branch 'longitude-wraparound-360' into tile-join-actual-zooms
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-f committed Nov 7, 2023
2 parents a3a91ad + 2225289 commit 5d1ec0b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 2.36.0

* Make tile-join distrust the source tilesets' metadata maxzoom and minzoom
* Add a special case in --detect-longitude-wraparound not to wrap around jumps of exactly 360°

# 2.35.0

Expand Down
7 changes: 5 additions & 2 deletions serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading

0 comments on commit 5d1ec0b

Please sign in to comment.