From 92d28634410ce37b98d37ea182654d0080073096 Mon Sep 17 00:00:00 2001 From: xmd5a Date: Fri, 29 Jul 2016 11:09:49 +0300 Subject: [PATCH] Ignore hiking routes in search if too close --- .../src/net/osmand/search/SearchUICore.java | 18 ++++++++++++++++++ OsmAnd/res/values-ru/phrases.xml | 2 ++ OsmAnd/res/values/phrases.xml | 2 ++ 3 files changed, 22 insertions(+) diff --git a/OsmAnd-java/src/net/osmand/search/SearchUICore.java b/OsmAnd-java/src/net/osmand/search/SearchUICore.java index 2e81416e62..1f1d6543c0 100644 --- a/OsmAnd-java/src/net/osmand/search/SearchUICore.java +++ b/OsmAnd-java/src/net/osmand/search/SearchUICore.java @@ -260,6 +260,24 @@ public class SearchUICore { if(ObjectType.isAddress(r1.objectType) && ObjectType.isAddress(r2.objectType)) { similarityRadius = 100; } + if (a1.getSubType().contains("cn_ref") && a2.getSubType().contains("cn_ref") && a1.getType().getKeyName().equals(a2.getType().getKeyName())) { + similarityRadius = 10000; + } + if (a1.getSubType().contains("wn_ref") && a2.getSubType().contains("wn_ref") && a1.getType().getKeyName().equals(a2.getType().getKeyName())) { + similarityRadius = 10000; + } + if (a1.getSubType().equals("route_hiking_iwn_poi") && a2.getSubType().equals("route_hiking_iwn_poi") && a1.getType().getKeyName().equals(a2.getType().getKeyName())) { + similarityRadius = 10000; + } + if (a1.getSubType().equals("route_hiking_nwn_poi") && a2.getSubType().equals("route_hiking_nwn_poi") && a1.getType().getKeyName().equals(a2.getType().getKeyName())) { + similarityRadius = 10000; + } + if (a1.getSubType().equals("route_hiking_rwn_poi") && a2.getSubType().equals("route_hiking_rwn_poi") && a1.getType().getKeyName().equals(a2.getType().getKeyName())) { + similarityRadius = 10000; + } + if (a1.getSubType().equals("route_hiking_lwn_poi") && a2.getSubType().equals("route_hiking_lwn_poi") && a1.getType().getKeyName().equals(a2.getType().getKeyName())) { + similarityRadius = 10000; + } return MapUtils.getDistance(r1.location, r2.location) < similarityRadius; } } diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index d55ba91e8d..9e2061d3b5 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -3014,4 +3014,6 @@ Выгребная яма Утилизация отходов: контейнер + Длина + diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml index 1faea4bdf2..3d9acb762c 100644 --- a/OsmAnd/res/values/phrases.xml +++ b/OsmAnd/res/values/phrases.xml @@ -3019,4 +3019,6 @@ Toilets disposal: chemical Toilets disposal: bucket + Length +