Skip to content
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

[Utility] Check bounding box validity #40

Closed
cbeddow opened this issue Jul 8, 2021 · 4 comments · Fixed by #116
Closed

[Utility] Check bounding box validity #40

cbeddow opened this issue Jul 8, 2021 · 4 comments · Fixed by #116
Assignees
Labels
feature A feature request for the SDK utility

Comments

@cbeddow
Copy link
Member

cbeddow commented Jul 8, 2021

Is your feature request related to a problem? Please describe.
Related to #27 and #39

The user could pass bad values such as strange numbers or invalid values, or reverse the values like a latitude,longitude instead of longitude,latitude order

Describe the solution you'd like
We should consider a validity check here. A bbox should always consist of a (lon,lat) for the lower left (i.e. southwest) corner of a box, and (lon,lat) for the upper right (northeast) corner.

  1. longitude range: has a min value of -180, a max value of 180
  2. latitude range: has a min value of -90, max value of 90
  3. latitude compare: in a bbox of [west,south,east,north] the value of south should always be smaller than the value of north (because south is lower, closer to -90, north is higher toward 90, even if both are negative)
  4. longitude compare: in a bbox of [west,south,east,north] the value of west should always be smaller than the value of east, EXCEPT if the bbox crosses the international dateline, which we can check with [Utility] International dateline check for bbox #39. Technically any time that west > east it could cross the dateline, but could also be an error. If it passes the dateline test we should just consider it valid.
  5. zero values: 0 is valid for all values in a bbox n a bbox of [west,south,east,north] the value
  6. equal values: we should never see east == west and never see south == north. This produces a flat box or line that has no inner size to get data within

Describe alternatives you've considered
Alternative could be to let the user just get a message that the function fails and somewhere it will be due to an a invalid bounding box, but not made clear to the user

@OmarMuhammedAli
Copy link
Contributor

OmarMuhammedAli commented Aug 8, 2021

@joeyouss is working on this issue!

@Rubix982
Copy link
Contributor

Rubix982 commented Aug 8, 2021

Welcome, @joeyouss!

@Rubix982
Copy link
Contributor

Rubix982 commented Aug 9, 2021

@joeyouss, if you need any help or if you run into any problems, let us know!

@Rubix982 Rubix982 assigned JoelMarcey and unassigned JoelMarcey Aug 9, 2021
@joeyouss
Copy link
Contributor

Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A feature request for the SDK utility
Projects
Development

Successfully merging a pull request may close this issue.

5 participants