From b57b7ef268e1d9450a765f1ad461baa62b7e2492 Mon Sep 17 00:00:00 2001 From: Kseniia Date: Wed, 13 Jan 2021 09:40:20 +0200 Subject: [PATCH] fix interpolation for alphabetic --- .../main/java/net/osmand/data/Building.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/data/Building.java b/OsmAnd-java/src/main/java/net/osmand/data/Building.java index 9d11828dbf..379b399fe9 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/Building.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/Building.java @@ -113,15 +113,20 @@ public class Building extends MapObject { String fname = super.getName(); int numB = Algorithms.extractFirstIntegerNumber(fname); int numT = numB; - if (num >= numB) { - String sname = getName2(); - if (getInterpolationType() == BuildingInterpolation.ALPHABETIC) { - char ch = hno.charAt(hno.length() - 1); - char chF = fname.charAt(fname.length() - 1); - if (chF < ch) { - return -1; - } + String sname = getName2(); + + if (getInterpolationType() == BuildingInterpolation.ALPHABETIC && num == numB) { + char ch = hno.charAt(hno.length() - 1); + char chF = fname.charAt(fname.length() - 1); + char chS = sname.charAt(sname.length() - 1); + if (chS < chF && chF < ch) { + return -1; } + if (chS > chF && ch < chF) { + return -1; + } + } + if (num >= numB) { if (fname.contains("-") && sname == null) { int l = fname.indexOf('-'); sname = fname.substring(l + 1, fname.length());