-
-
Notifications
You must be signed in to change notification settings - Fork 362
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
Formal BBox struct #377
base: main
Are you sure you want to change the base?
Formal BBox struct #377
Conversation
fabd9d0
to
4e65ed6
Compare
0faf517
to
aa7a51d
Compare
Blocked on #378 |
Okay, on my local machine, I've definitely swapped a lat/lng somewhere... because renders are no longer working :( I'll try to figure out which |
aa7a51d
to
4776f60
Compare
pub fn from_str(s: &str) -> Result<Self, String> { | ||
let [min_lat, min_lng, max_lat, max_lng]: [f64; 4] = s | ||
.split(',') | ||
.map(|e| e.parse().unwrap()) |
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.
Should this return an Err
signifying parsing failure?
.map(|e| e.parse().unwrap()) | ||
.collect::<Vec<_>>() | ||
.try_into() | ||
.unwrap(); |
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.
Should this return an Err
? What cases will the try_into
fail?
4776f60
to
a6310f5
Compare
fn reorder_bbox(bbox: &[f64]) -> (f64, f64, f64, f64) { | ||
(bbox[1], bbox[0], bbox[3], bbox[2]) | ||
} |
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.
hm, do I still need to do this? Maybe we can just make the GUI return it in the right order in the first place...
a6310f5
to
ad642c9
Compare
src/retrieve_data.rs
Outdated
bbox.1, bbox.0, bbox.3, bbox.2 | ||
bbox.min().lng, | ||
bbox.min().lat, | ||
bbox.max().lng, | ||
bbox.max().lat |
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's gotta be this that's causing the issue.
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.
Okay, I might be wrong, because when I switch these around, the API doesn't return any data. I guess I'm stumped as to why this no longer works.
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.
`BBox` represents a *valid* bounding box. It's only possible to have a BBox object that's valid.
ad642c9
to
c4a0f11
Compare
We need a more standardized way to represent bounding boxes, as we kind of just throw the string around and parse it into the four corresponding values when we need to.
Fixes #375
To Do