-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
TGIS: add spatial filter to STDS #2725
Conversation
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.
One small question, no change request. For me ready to merge as it is.
spatial_where_template += " AND top > {b}" " AND bottom < {t}" | ||
spatial_where_template += ")" | ||
|
||
spatial_where_list = [spatial_where_template.format(**spatial_extent)] |
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.
This adds 3 spatial filters to the where statement, should work.
Maybe it would be more efficient to shift the spatial filter to the actual extent of the STDS to reduce the where statements?
Please go ahead with merging, I'll test once the functionality is included in |
Thanks for your feedback, @metzm and @veroandreo. @metzm : I am interested in improving the performance, esp. for larger STDS. Unfortunately, I don` think I can follow your idea of "shifting the spatial filter to the actual extent of the STDS to reduce the where statements"? Can you explain? Now, I implemented handling of different spatial relations and added that to more relevant functions in the abstract_space_time_dataset.py. Spatial relations currently supported are I am fully open to renaming the spatial relations, if you think other terms are more appropriate. In relevant modules (e.g. |
OK, I tested now with some artificial data in WGS84 and data / extents that wrap around the -180/18+ meridian and it seems to work as expected.
If there are no objections I will merge this rather soon and then add a new PR to make use of the modified function in a first module (likely I would like to add a doctest to the function, but doctests seem deactivated for this module... In unittests I am not sure how to include a WGS84 test... Hints are welcome... |
* add indices on bbox * add spatial extent filter * implement spatial relations in spatial filtering
* add indices on bbox * add spatial extent filter * implement spatial relations in spatial filtering
This PR implements spatial filtering in the temporal library, in particular the
get_registered_maps
andget_registered_maps_as_objects
functions.The API should be unchanged, so that module code using those functions should not be affected.
If the library implementation is acceptable, it can be included in relevant module and library code.
Currently, only maps that are spatially not overlapping / intersecting with a given spatial_extent (e.g. from the computational region) are removed from the results of the functions named above.
If there is a need to support other spatial relations (like within or contains) the implementation needs to be modified a bit, and subsequent modificatins of module code may have to use an option (with the allowed spatial relation to the relevant spatial extent (e.g. computational region)) instead of a flag.
Any feedback is welcome. Module code will be worked on in separate PR(s).
See: https://lists.osgeo.org/pipermail/grass-dev/2022-December/095837.html
for discussion on ML.