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

Integrate "geospatial.py" module with new "validate_spatial" class #321

Closed
sjh1024 opened this issue Jun 23, 2022 · 3 comments · Fixed by #322
Closed

Integrate "geospatial.py" module with new "validate_spatial" class #321

sjh1024 opened this issue Jun 23, 2022 · 3 comments · Fixed by #322

Comments

@sjh1024
Copy link
Contributor

sjh1024 commented Jun 23, 2022

No description provided.

@sjh1024 sjh1024 changed the title Integrate " Integrate "geospatial.py" module with new "validate_spatial" class Jun 23, 2022
@sjh1024
Copy link
Contributor Author

sjh1024 commented Jun 23, 2022

From @JessicaS11's comment on #318 -

It is worth thinking about how the spatial portion might be (potentially) combined with the geospatial.py module as well as utilizing existing libraries to the extent possible to validate and refine inputs. For instance, using Shapely:

import shapely.geometry as geom
bbox = [-55, 68, -48, 71]
b_bbox = [-55, 71, -48, 68]

fmtbox = geom.box(*bbox)
b_fmtbox = geom.box(*b_bbox)

Both fmtbox and b_fmtbox will output (-55.0, 68.0, -48.0, 71.0) as the valid, correctly formatted bounding box. In this case, we could eliminate completely the check + user warning that they entered the coordinates in the wrong order. However, this DOES NOT deal with #151 (which I think is due to #117) and would actually make cross-dateline queries more challenging, so we should keep that in mind before implementing this route (perhaps requiring the user to manually specify via keyword they intend to cross the dateline with their query and then handling the request accordingly?).

@sjh1024
Copy link
Contributor Author

sjh1024 commented Jun 23, 2022

Decided to make this a separate issue so I can look into it after the "first" version of the spatial class is merged into development (basically the same as the original spatial function in validate_inputs with a few structural changes)

@sjh1024
Copy link
Contributor Author

sjh1024 commented Jul 29, 2022

Issue has been resolved with PR #322

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant