-
Notifications
You must be signed in to change notification settings - Fork 74
v0.2.53..v0.2.54 changeset Point.js
Garret Voltz edited this page Mar 31, 2020
·
1 revision
diff --git a/rules/Point.js b/rules/Point.js
index c7637a0..2da75d6 100644
--- a/rules/Point.js
+++ b/rules/Point.js
@@ -18,7 +18,7 @@ exports.tagThreshold = parseFloat(hoot.get("generic.point.tag.threshold"));
exports.baseFeatureType = "Point";
exports.writeMatchedBy = hoot.get("writer.include.matched.by.tag");
exports.geometryType = "point";
-exports.matchCandidateCriterion = "hoot::PointCriterion"; // See #3047
+exports.matchCandidateCriterion = "hoot::PointCriterion";
function distance(e1, e2)
{
@@ -36,7 +36,7 @@ function distance(e1, e2)
*/
exports.isMatchCandidate = function(map, e)
{
- return isPoint(map, e) && !isSpecificallyConflatable(map, e);
+ return isPoint(map, e) && !isSpecificallyConflatable(map, e, exports.geometryType);
};
/**
@@ -82,14 +82,16 @@ exports.matchScore = function(map, e1, e2)
hoot.trace("e2 note: " + e2.getTags().get("note"));
}
- var typeScore = getTypeScore(map, e1, e2);
- var typeScorePassesThreshold = false;
- if (typeScore >= exports.tagThreshold)
+ // TODO: Should we do anything with names?
+
+ // If both features have types and they aren't just generic types, let's do a detailed type comparison and
+ // look for an explicit type mismatch. Otherwise, move on to the geometry comparison.
+ var typeScorePassesThreshold = !explicitTypeMismatch(e1, e2, exports.tagThreshold);
+ hoot.trace("typeScorePassesThreshold: " + typeScorePassesThreshold);
+ if (!typeScorePassesThreshold)
{
- typeScorePassesThreshold = true;
+ return result;
}
- hoot.trace("typeScore: " + typeScore);
- hoot.trace("typeScorePassesThreshold: " + typeScorePassesThreshold);
var error1 = e1.getCircularError();
var error2 = e2.getCircularError();