Skip to content

Commit

Permalink
fix: handle bbox for globe-spanning geoms
Browse files Browse the repository at this point in the history
  • Loading branch information
gadomski committed Oct 17, 2024
1 parent 6e6db05 commit d9eff54
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/antimeridian/_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,9 @@ def bbox(
xmaxs.append(bounds[2])
if bounds[3] > ymax:
ymax = bounds[3]
if is_coincident_to_antimeridian(polygon):
if is_coincident_to_antimeridian(polygon) and not (
bounds[0] == -180 and bounds[2] == 180
):
crosses_antimeridian = True

if crosses_antimeridian or force_over_antimeridian:
Expand Down
1 change: 1 addition & 0 deletions tests/data/output/ocean.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/test_bbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
("split", [170, 40, -170, 50]),
("multi-no-antimeridian", [90, 10, 100, 50]),
("north-pole", [-180, 40, 180, 90]),
("ocean", [-180, -85.609, 180, 90]),
],
)
def test_bbox(read_output: Reader, name: str, expected: List[float]) -> None:
Expand Down

0 comments on commit d9eff54

Please sign in to comment.