Skip to content

v0.2.52..v0.2.53 changeset Railway.js

Garret Voltz edited this page Feb 12, 2020 · 1 revision
diff --git a/rules/Railway.js b/rules/Railway.js
index 2b290b8..ea18cfa 100644
--- a/rules/Railway.js
+++ b/rules/Railway.js
@@ -1,13 +1,21 @@
+/**
+ * This script conflates railways using Generic Conflation.
+ */
+
 "use strict";
 
 exports.description = "Matches railways";
 exports.experimental = false;
 exports.baseFeatureType = "Railway";
+exports.geometryType = "line";
 
 exports.candidateDistanceSigma = 1.0; // 1.0 * (CE95 + Worst CE95);
-exports.matchThreshold = parseFloat(hoot.get("railway.match.threshold"));
-exports.missThreshold = parseFloat(hoot.get("railway.miss.threshold"));
-exports.reviewThreshold = parseFloat(hoot.get("railway.review.threshold"));
+// This matcher only sets match/miss/review values to 1.0, therefore the score thresholds aren't used. 
+// If that ever changes, then the generic score threshold configuration options used below should 
+// be replaced with custom score threshold configuration options.
+exports.matchThreshold = parseFloat(hoot.get("conflate.match.threshold.default"));
+exports.missThreshold = parseFloat(hoot.get("conflate.miss.threshold.default"));
+exports.reviewThreshold = parseFloat(hoot.get("conflate.review.threshold.default"));
 
 var sublineMatcher =
   new hoot.MaximalSublineStringMatcher(
@@ -124,10 +132,9 @@ exports.matchScore = function(map, e1, e2)
  */
 exports.mergeSets = function(map, pairs, replaced)
 {
-  hoot.trace("Merging elements.");
   // snap the ways in the second input to the first input. Use the default tag
   // merge method.
-  return snapWays(sublineMatcher, map, pairs, replaced);
+  return snapWays(sublineMatcher, map, pairs, replaced, exports.baseFeatureType);
 };
 
 exports.getMatchFeatureDetails = function(map, e1, e2)
Clone this wiki locally