Make approximate contains slack configurable #67
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For the named area contains relation, we use an approximate contains relation. Its slack has so far been hardcoded. It makes sense to makes this configurable. The first commit in this PR adds a variable
APPROX_CONTAINS_SLACK
inGeometryHandler.h
.This is particularly important as we currently cannot build the OpenHistoricalMap dataset (see ad-freiburg/qlever#1220) with an approximate contains relation. Basically, the problem is that for some administrative areas, we have many versions which differ only slightly. If the difference is within the allowed slack, none of our existing speedup heuristics are effective (they notice that we are not contained, but do not abort as we might be approximately contained), and we must compute a full intersection of the polygons A, B to compute whether A is approximately contained in B. If
APPROX_CONTAINS_SLACK
is 0, then we can immediately decide that A is not in B in such cases by a simple floating point comparison (the geometric area of A vs. the geometric area of B).As an example, see https://www.openhistoricalmap.org/relation/2704379 and https://www.openhistoricalmap.org/relation/2704296, which are two of the (dozens of) versions of the boundaries of San Jose. Because of cases like this, it took 24h hours on our standard build machine to process 3% (sic!) of the named areas in the latest OHM planet file.
@lehmann-4178656ch, it would be nice if you could add a configuration parameter for this.