outer_boundary_corners and __contains__ raise ValueError on some areas
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 385
- Forks
- 102
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 9
Description
Checking the outer boundary corners of some areas fails with ValueError. In this case, checking if a certain point is contained also fails.
Code Sample, a minimal, complete, and verifiable piece of code
from pyresample.area_config import parse_area_file
area = parse_area_file(
"/data/gholl/checkouts/satpy/satpy/etc/areas.yaml",
"seviri_0deg")[0]
print((0, 0) in area)
print(area.outer_boundary_corners)
Problem description
raises ValueError, probably because the Earth is round and has no corners.
Expected Output
For the outer_boundary_corners, maybe NaN would be appropriate, or maybe a ValueError is actually correct. However, I don't think (lon, lat) in area should raise a ValueError for any valid lon/lat (see also #268). For valid input, this should always return either True or False.
Actual Result, Traceback if applicable
Traceback (most recent call last):
File "/data/gholl/checkouts/protocode/mwe/outer-corners.py", line 5, in <module>
print(area.outer_boundary_corners)
File "/data/gholl/checkouts/pyresample/pyresample/geometry.py", line 2134, in outer_boundary_corners
return [Coordinate(corner_lons[0], corner_lats[0]),
File "/data/gholl/checkouts/pyresample/pyresample/spherical_geometry.py", line 50, in __init__
raise ValueError('Illegal (lon, lat) coordinates: (%s, %s)'
ValueError: Illegal (lon, lat) coordinates: (inf, inf)
Versions of Python, package at hand and relevant dependencies
pyresample v1.22.0-8-gee7c1b9
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the example using pyresample/geometry.py and inspect how outer_boundary_corners produces coordinates before they are passed to pyresample/spherical_geometry.py:50. Compare that path with the area containment check. Done means valid longitude/latitude input returns True or False from contains, with the intended behavior for invalid outer-boundary corners established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100