Skip to content

Commit

Permalink
fix geospatial range check
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis authored Aug 28, 2024
1 parent 1e83a3d commit 643a8ff
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pywcmp/wcmp2/ets.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,10 @@ def test_requirement_extent_geospatial(self):
geometry = shape(self.record['geometry'])
bounds = geometry.bounds

x_range = range(-180, 180)
y_range = range(-90, 90)

if not all([bounds[0] in x_range,
bounds[1] in y_range,
bounds[2] in x_range,
bounds[3] in y_range]):
if not all([-180 <= bounds[0] <= 180,
-90 <= bounds[1] <= 90,
-180 <= bounds[2] <= 180,
-90 <= bounds[3] <= 90]):

status['code'] = 'FAILED'
status['messsage'] = 'Invalid geometry'
Expand Down

0 comments on commit 643a8ff

Please sign in to comment.