Skip to content

Commit

Permalink
make overlap threshold for area reviews configurable (#4318)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwitham authored Oct 19, 2020
1 parent 3f88779 commit 2ac53ac
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
10 changes: 9 additions & 1 deletion conf/core/ConfigOptions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,14 @@ input as part of the query. This is more inefficient for memory consumption but
overall for significantly large datasets, as the cropped database query performs slowly at larger
input sizes.

=== area.overlap.review.threshold

* Data Type: double
* Default Value: `0.835`

Areas that do not match and have a percentage overlap at or above this value will be marked for
review.

=== area.tag.threshold

* Data Type: double
Expand Down Expand Up @@ -318,7 +326,7 @@ option may result in some false positive road joining.
* Data Type: bool
* Default Value: `true`

If true, allows Attribute Conflation to modify the geometry of a reference road layer to accomodate
If true, allows Attribute Conflation to modify the geometry of a reference road layer to accommodate
bridge features. If false, any bridge features represented in the secondary dataset, but not in the
reference dataset will be lost.

Expand Down
1 change: 1 addition & 0 deletions conf/services/conflationTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"matcher": "hoot::ScriptMatchCreator,Area.js",
"merger": "hoot::ScriptMergerCreator",
"members": {
"area.overlap.review.threshold": "Overlap review threshold; 0.0 to 1.0",
"search.radius.area": "Search radius (m); -1 for default",
"area.tag.threshold": "Tag match threshold; 0.0 to 1.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ class Element;
/**
* Based on the JCS OverlapExtractor.
*
* This extractor uses the building with more overlap to calculate the percentage overlap. For
* instance if you have a small building contained within a larger building the result will be 1.
* This extractor uses the feature with more overlap to calculate the percentage overlap. For
* instance if you have a small feature contained within a larger feature, the result will be 1.0.
*
* If either building has an area of zero then a zero is returned.
* If either feature has an area of zero, then zero is returned.
*
* @author RoadMatcher
* @copyright GPL
Expand Down
6 changes: 5 additions & 1 deletion rules/Area.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ nodes and polygons or a school polygon which encloses school buildings on the ca
*/
exports.isMatchCandidate = function(map, e)
{
hoot.trace("e: " + e.getElementId());
hoot.trace("isNonBuildingArea: " + isNonBuildingArea(map, e));

return isNonBuildingArea(map, e);
};

Expand Down Expand Up @@ -200,7 +203,8 @@ exports.matchScore = function(map, e1, e2)
smallerOverlap = smallerOverlapExtractor.extract(map, e1, e2);
hoot.trace("smallerOverlap: " + smallerOverlap);
}
if (smallerOverlap > 0.835)
var overlapReviewThreshold = parseFloat(hoot.get("area.overlap.review.threshold"));
if (smallerOverlap >= overlapReviewThreshold)
{
hoot.trace("review");
result = { match: 0.0, miss: 0.0, review: 1.0 };
Expand Down
2 changes: 1 addition & 1 deletion rules/River.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function geometryMismatch(map, e1, e2)
hoot.trace(sublines);
if (sublines && sublines == "RecursiveComplexityException")
{
// If receive the specfic string above from the matching routine, we know our subline matcher
// If we receive the specfic string above from the matching routine, we know our subline matcher
// hit the cap on the number of recursive calls we allow for it
// (see waterway.maximal.subline.max.recursive.complexity above; A little kludgy, but not sure
// how to handle hoot exceptions in a js script at this point). So, now we'll try a backup matcher
Expand Down

0 comments on commit 2ac53ac

Please sign in to comment.