support antimeridian bbox cases (#837)
This commit is contained in:
+6
-2
@@ -3237,11 +3237,15 @@ def validate_bbox(value=None) -> list:
|
||||
LOGGER.debug(msg)
|
||||
raise
|
||||
|
||||
if bbox[0] > bbox[2] or bbox[1] > bbox[3]:
|
||||
msg = 'min values should be less than max values'
|
||||
if bbox[1] > bbox[3]:
|
||||
msg = 'miny should be less than maxy'
|
||||
LOGGER.debug(msg)
|
||||
raise ValueError(msg)
|
||||
|
||||
if bbox[0] > bbox[2]:
|
||||
msg = 'minx is greater than maxx (possibly antimeridian bbox)'
|
||||
LOGGER.debug(msg)
|
||||
|
||||
return bbox
|
||||
|
||||
|
||||
|
||||
@@ -1504,6 +1504,9 @@ def test_validate_bbox():
|
||||
assert (validate_bbox('-142.1,42.12,-52.22,84.4') ==
|
||||
[-142.1, 42.12, -52.22, 84.4])
|
||||
|
||||
assert (validate_bbox('177.0,65.0,-177.0,70.0') ==
|
||||
[177.0, 65.0, -177.0, 70.0])
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
validate_bbox('1,2,4')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user