SFCGAL
SFCGAL copied to clipboard
Enhance covers()
The implementation of Covers() is very naive. It is used internally to "cleanup" geometries after splitting them into geometry sets. There must be ways to have a better covers implementation, especially one that do not use constructions, but only predicates
@mhugo @lbartoletti this is of particular interest as the algorithm is particularly expensive and frequently used. Consequently, I am currently looking into this issue. If there has been any more progress please can it be posted here? Thanks.
What is Covers()
doing (input -> output) ?
It effectively checks that for two geometries A and B, covers(A,b) checks if the intersection of A and B is "equal" to B. The equality check is done using comparisons of point count, segment lengths, surface areas, solid volume, where appropriate, according to the dimension of the inputs. The todo in the implementation suggests the following improvement as indicated in the ticket description:
// // This is a very naive (not efficient) implementation of covers() ! // // covers(A,B) <=> A inter B == B // '==' is here implemented with comparison of length, area and volumes // TODO use only predicates if possible