stac-pydantic icon indicating copy to clipboard operation
stac-pydantic copied to clipboard

fix bbox validation

Open ujjwal360 opened this issue 10 months ago • 5 comments

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 https://github.com/stac-utils/stac-pydantic/issues/122 and i am encountering the same validation error in https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch

ujjwal360 avatar Feb 06 '25 19:02 ujjwal360

@ujjwal360 thanks for opening (and closing and re-opening 😅) this PR

Could you add some test for this 🙏

vincentsarago avatar Feb 06 '25 21:02 vincentsarago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.15%. Comparing base (a927d25) to head (3616d2d). Report is 81 commits behind head on main.

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     
Flag Coverage Δ
unittests 96.15% <100.00%> (-0.44%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Feb 06 '25 21:02 codecov-commenter

@ujjwal360 thanks for opening (and closing and re-opening 😅) this PR

Could you add some test for this 🙏

thanks for the quick response @vincentsarago, i was having serious second thoughts even though its a small change! 😅 i'll add a test asap

ujjwal360 avatar Feb 06 '25 21:02 ujjwal360

@vincentsarago hope test looks good

ujjwal360 avatar Feb 06 '25 22:02 ujjwal360

@vincentsarago any thoughts on removing xmax < xmin check? thanks!

ujjwal360 avatar Feb 26 '25 21:02 ujjwal360