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

Check if bbox of intersection is valid #2040

Open
adriantre opened this issue May 2, 2024 · 4 comments
Open

Check if bbox of intersection is valid #2040

adriantre opened this issue May 2, 2024 · 4 comments
Labels
datasets Geospatial or benchmark datasets samplers Samplers for indexing datasets

Comments

@adriantre
Copy link
Contributor

adriantre commented May 2, 2024

We experienced that the resulting bounding box of the intersection between hits (files) had minx > maxx. This may be because the VectorDatasets consist of points, and the intersection between these two files may be a singularity.

This line does not check the validity, and this was not uncovered until later in the code where dataset.bounds was called, triggering this check.

What I don't understand is why __post_init__ and the check were not triggered when merging the two bounds in box3 = box1 & box2.

if box3.area > 0 or box1.area == 0 or box2.area == 0:

@adriantre adriantre changed the title Check if Intersection Check if bbox of intersection is valid May 2, 2024
@adamjstewart
Copy link
Collaborator

Can you provide a minimal reproducible example? If not, I can't really figure out why you're seeing minx > maxx...

@adamjstewart adamjstewart added datasets Geospatial or benchmark datasets samplers Samplers for indexing datasets labels May 2, 2024
@adriantre
Copy link
Contributor Author

I'll see what I can do.

@adriantre
Copy link
Contributor Author

I get this info second hand from some students, but it looks like it stems from random_bbox_assignment yielding an empty val_dataset. We tested this on a small dataset, so it will be resolved when more data is introduced. Still weird that the check does not get triggered, but I guess it may no be worth spending too much time on resolving it.

@adamjstewart
Copy link
Collaborator

This makes sense, I've seen this too with other splitting functions. Let's keep this issue open, it seems to be a common mistake, and Toblerity/rtree#204 makes it much more difficult to understand what is wrong or how to solve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datasets Geospatial or benchmark datasets samplers Samplers for indexing datasets
Projects
None yet
Development

No branches or pull requests

2 participants