-
Notifications
You must be signed in to change notification settings - Fork 31
add spatial intervals validation #178
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
Conversation
stac_pydantic/collection.py
Outdated
|
||
# if bbox is crossing the Antimeridian limit we move xmax to the west | ||
if xmin > xmax: | ||
xmax = 180 - (xmax % 360) |
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.
stac_pydantic/collection.py
Outdated
# │ │ ┌──────┐ │ ┌─────────┐ │ │ | ||
# └──│──► 2 │ │ │ 1 │ │ │ | ||
# │ │ │ │ │ │◄────│────────┘ | ||
# │ └──────┘ │ └─────────┘ │ |
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.
The left case is:
xmax < xmin_sub and xmax < xmax_sub
Right case is:
xmin > xmin_xub and xmin > xmax_sub
Middle case is:
xmax < xmax_sub and xmin < xmin_sub
Co-authored-by: Pete Gadomski <pete.gadomski@gmail.com>
Co-authored-by: Pete Gadomski <pete.gadomski@gmail.com>
Co-authored-by: Pete Gadomski <pete.gadomski@gmail.com>
Co-authored-by: Pete Gadomski <pete.gadomski@gmail.com>
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.
I think the suggestions are needed, but this stuff sometimes can be guess-and-check for me 🫠. I don't think 0
should show up in the checks at all, though...
stac_pydantic/collection.py
Outdated
raise error_msg | ||
|
||
# case 1 | ||
elif xmax_sub <= 0 and xmax_sub > xmax: |
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.
elif xmax_sub <= 0 and xmax_sub > xmax: | |
elif xmax_sub > xmax or xmin_sub > xmax: |
stac_pydantic/collection.py
Outdated
raise error_msg | ||
|
||
# case 2 | ||
elif xmin_sub >= 0 and xmin_sub < xmin: |
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.
elif xmin_sub >= 0 and xmin_sub < xmin: | |
elif xmin_sub < xmin or xmax_sub < xmin: |
@gadomski I've added more comments to explain the reasoning for the |
following #177