bool CustomPoiMatch::_isExactMatch(const ConstNodePtr& n1, const ConstNodePtr& n2) const { // distance that is considered an exact match. Defaults to 1mm. Meters epsilon = conf().getDouble(epsilonDistanceKey(), 1e-3); bool result = true; if (n1->getElementId() == n2->getElementId()) { // pass, return = true } else if (n1->toCoordinate().distance(n2->toCoordinate()) > epsilon) { result = false; } else { // if at least one name pair is an exact match then it is an exact string match. double stringDistance = NameExtractor(new ExactStringDistance()).extract(n1, n2); if (stringDistance != 1.0) { result = false; } } return result; }
double PoiPolygonMatch::_calculateNameScore(ConstElementPtr e1, ConstElementPtr e2) const { // found experimentally when doing building name comparisons double score = NameExtractor( new TranslateStringDistance( new MeanWordSetDistance(new LevenshteinDistance(1.45)))).extract(e1, e2); return score; }
bool CustomPoiMatch::_isNameMatch(const ConstNodePtr& n1, const ConstNodePtr& n2) const { // if at least one name pair is a match then call it a match double stringDistance = NameExtractor(new CustomStringDistance()).extract(n1, n2); bool result = true; if (stringDistance != 1.0) { result = false; } return result; }