Package com.graphhopper.routing.util
Class NameSimilarityEdgeFilter
java.lang.Object
com.graphhopper.routing.util.NameSimilarityEdgeFilter
- All Implemented Interfaces:
EdgeFilter
This class defines the basis for NameSimilarity matching using an EdgeFilter. It is not thread-safe.
The typical use-case is to match not the nearest edge in
LocationIndex.findClosest(double, double, EdgeFilter)
but the edge with the name that is similar to the specified pointHint and still close.
Names that are similar to each other are (n1 name1, n2 name2):
- n1 == n2
- n1 is significant substring of n2, e.g: n1="Main Road", n2="Main Road, New York"
- n1 and n2 contain a reasonable longest common substring, e.g.: n1="Cape Point / Cape of Good Hope", n2="Cape Point Rd, Cape Peninsula, Cape Town, 8001, Afrique du Sud"
The aim is to allow minor typos/differences of the substrings, without having too much false positives.
- Author:
- Robin Boldt, Peter Karich
-
Field Summary
Fields inherited from interface com.graphhopper.routing.util.EdgeFilter
ALL_EDGES
-
Constructor Summary
ConstructorsConstructorDescriptionNameSimilarityEdgeFilter
(EdgeFilter edgeFilter, String pointHint, GHPoint point, double radius) NameSimilarityEdgeFilter
(EdgeFilter edgeFilter, String pointHint, GHPoint point, double radius, Map<String, String> rewriteMap) -
Method Summary
-
Constructor Details
-
NameSimilarityEdgeFilter
public NameSimilarityEdgeFilter(EdgeFilter edgeFilter, String pointHint, GHPoint point, double radius) -
NameSimilarityEdgeFilter
public NameSimilarityEdgeFilter(EdgeFilter edgeFilter, String pointHint, GHPoint point, double radius, Map<String, String> rewriteMap) - Parameters:
radius
- the searchable region about the point in metersrewriteMap
- maps abbreviations to its longer form
-
-
Method Details
-
accept
- Specified by:
accept
in interfaceEdgeFilter
- Returns:
- true if the current edge should be processed and false otherwise.
-