Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-07-25 20:20:33 +02:00
commit 13df2e2d75
3 changed files with 8 additions and 2 deletions

View file

@ -246,13 +246,16 @@ public class SearchUICore {
a2 = (Amenity) r2.object;
}
if (r1.localeName.equals(r2.localeName)) {
double similarityRadius = 20;
double similarityRadius = 30;
if(a1 != null && a2 != null) {
if(a1.getType().getKeyName().equals("natural") &&
a2.getType().getKeyName().equals("natural")) {
similarityRadius = 10000;
}
}
if(ObjectType.isAddress(r1.objectType) && ObjectType.isAddress(r2.objectType)) {
similarityRadius = 100;
}
return MapUtils.getDistance(r1.location, r2.location) < similarityRadius;
}
}

View file

@ -21,4 +21,8 @@ public enum ObjectType {
return hasLocation;
}
public static boolean isAddress(ObjectType t ) {
return t == CITY || t == VILLAGE || t == POSTCODE || t == STREET || t == HOUSE || t == STREET_INTERSECTION;
}
}

View file

@ -1,7 +1,6 @@
package net.osmand.search.core;
import java.util.Collection;
import java.util.List;
import net.osmand.binary.BinaryMapIndexReader;
import net.osmand.data.LatLon;