File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -79,11 +79,14 @@ def validate_bbox(cls, v: BBox) -> BBox:
79
79
raise ValueError (
80
80
"Maximum elevation must greater than minimum elevation"
81
81
)
82
+ # Validate against WGS84
83
+ if xmin < - 180 or ymin < - 90 or xmax > 180 or ymax > 90 :
84
+ raise ValueError ("Bounding box must be within (-180, -90, 180, 90)" )
82
85
83
86
if xmax < xmin :
84
87
# xmin > xmax is permitted when crossing the antimeridian
85
88
# https://datatracker.ietf.org/doc/html/rfc7946#section-5.2
86
- if not ((xmin < 0 ) and (xmax > 0 )):
89
+ if not ((xmax < 0 ) and (xmin > 0 )):
87
90
raise ValueError (
88
91
"Maximum longitude must be greater than minimum longitude"
89
92
)
@@ -93,10 +96,6 @@ def validate_bbox(cls, v: BBox) -> BBox:
93
96
"Maximum longitude must be greater than minimum longitude"
94
97
)
95
98
96
- # Validate against WGS84
97
- if xmin < - 180 or ymin < - 90 or xmax > 180 or ymax > 90 :
98
- raise ValueError ("Bounding box must be within (-180, -90, 180, 90)" )
99
-
100
99
return v
101
100
102
101
@field_validator ("datetime" )
You can’t perform that action at this time.
0 commit comments