Skip to content

Commit

Permalink
Workaround swaths crossing the anti-meridian causing negative coverag…
Browse files Browse the repository at this point in the history
…e percentages
  • Loading branch information
djhoese committed Jun 20, 2024
1 parent a074dff commit b72a61b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions polar2grid/filters/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ def boundary_for_area(area_def: PRGeometry) -> Boundary:
try:
adp = area_def.boundary()
adp.decimate(int(freq_fraction * area_def.shape[0]))
if adp.contour_poly.area() < 0:
# https://github.com/ssec/polar2grid/issues/696
raise ValueError("Failed to generate valid polygon for area. Polygon has a negative area.")
except ValueError:
if not isinstance(area_def, SwathDefinition):
logger.error("Unable to generate bounding geolocation polygon")
Expand Down

0 comments on commit b72a61b

Please sign in to comment.