Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
13df2e2d75
3 changed files with 8 additions and 2 deletions
|
@ -246,13 +246,16 @@ public class SearchUICore {
|
||||||
a2 = (Amenity) r2.object;
|
a2 = (Amenity) r2.object;
|
||||||
}
|
}
|
||||||
if (r1.localeName.equals(r2.localeName)) {
|
if (r1.localeName.equals(r2.localeName)) {
|
||||||
double similarityRadius = 20;
|
double similarityRadius = 30;
|
||||||
if(a1 != null && a2 != null) {
|
if(a1 != null && a2 != null) {
|
||||||
if(a1.getType().getKeyName().equals("natural") &&
|
if(a1.getType().getKeyName().equals("natural") &&
|
||||||
a2.getType().getKeyName().equals("natural")) {
|
a2.getType().getKeyName().equals("natural")) {
|
||||||
similarityRadius = 10000;
|
similarityRadius = 10000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(ObjectType.isAddress(r1.objectType) && ObjectType.isAddress(r2.objectType)) {
|
||||||
|
similarityRadius = 100;
|
||||||
|
}
|
||||||
return MapUtils.getDistance(r1.location, r2.location) < similarityRadius;
|
return MapUtils.getDistance(r1.location, r2.location) < similarityRadius;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,4 +21,8 @@ public enum ObjectType {
|
||||||
return hasLocation;
|
return hasLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isAddress(ObjectType t ) {
|
||||||
|
return t == CITY || t == VILLAGE || t == POSTCODE || t == STREET || t == HOUSE || t == STREET_INTERSECTION;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package net.osmand.search.core;
|
package net.osmand.search.core;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.osmand.binary.BinaryMapIndexReader;
|
import net.osmand.binary.BinaryMapIndexReader;
|
||||||
import net.osmand.data.LatLon;
|
import net.osmand.data.LatLon;
|
||||||
|
|
Loading…
Reference in a new issue