-
Notifications
You must be signed in to change notification settings - Fork 18
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
improve performance for queries on sparse multipolygons #270
Comments
I don't know if this helps but when I had to check which polygon a geometry lies in and the polygons had 'bad bboxes' (e.g. france with DOM/TOM) created an STRTree of polygons, not Mulipolygons: stub:
depending on the cost of area or complexity calculation something like https://postgis.net/docs/ST_Subdivide.html (this surely exists in jts or geotools) on very large/complex/overlapping polygons could be used to increase performance of STRTree even further.
Attention, very ugly and possibly wrong code:
//EDIT: correct code that was copy pasted out of context |
yeah, for such geometries an implementation like what you propose would make sense. JTS even has a built-in utility/mechanism (called The crucial question would be to how to decide which implementation to use in which situation? And/or if it would be not even more performant to come up with a solution which can combine both approaches for sparse multipolygons: for the example of France -> split "distinct" regions into R-tree superstructure, and use the current fip routines to perform exact geometry tests. 🤔 |
great you did some benchmarking!!! Anyway I will share my thought at the risk of them being off-topic: |
Currently, when querying large, but very sparse multipolygons as areas-of-interest, it can happen that a lot of CPU time is spent inside the bbox <-> polygon testing, leading to poor performance:
In these situations, the current implementation of the
fip
package are not ideal (it assumes somewhat contiguous and not too unisotropic input polygons to work really well).see also https://github.com/GIScience/oshdb/blob/0.5.9/oshdb-util/src/main/java/org/heigit/bigspatialdata/oshdb/util/geometry/fip/FastInPolygon.java#L72
//cc @SlowMo24
The text was updated successfully, but these errors were encountered: