-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix bbox validation #167
base: main
Are you sure you want to change the base?
fix bbox validation #167
Conversation
@ujjwal360 thanks for opening (and closing and re-opening 😅) this PR Could you add some test for this 🙏 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #167 +/- ##
==========================================
- Coverage 96.59% 96.15% -0.44%
==========================================
Files 25 25
Lines 587 598 +11
==========================================
+ Hits 567 575 +8
- Misses 20 23 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
thanks for the quick response @vincentsarago, i was having serious second thoughts even though its a small change! 😅 i'll add a test asap |
@vincentsarago hope test looks good |
stac_pydantic/api/search.py
Outdated
) | ||
# xmin > xmax is permitted when crossing the antimeridian | ||
# https://datatracker.ietf.org/doc/html/rfc7946#section-5.2 | ||
if not ((xmax < 0) and (xmin > 0)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it does make sense to remove the
if xmax < xmin:
raise ValueError(
"Maximum longitude must be greater than minimum longitude"
)
check entirely
for the everything except
new zealand bbox, we would have a bounding box like
[ 180, -50, 165, -30]
small fix to bbox validation allowing x_min (south west longitude) to be greater than x_max (north east longitude) when crossing the anti meridian as per https://datatracker.ietf.org/doc/html/rfc7946#section-5.2
this issue was also reported in #122 and i am encountering the same validation error in https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch