Merge pull request #10564 from osmandapp/T7525
Add condition for BuildingInterpolation.ALPHABETIC
This commit is contained in:
commit
67c122ce03
1 changed files with 27 additions and 10 deletions
|
@ -113,8 +113,25 @@ 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) {
|
||||
if (num != numB) {
|
||||
// currently not supported
|
||||
return -1;
|
||||
}
|
||||
int hint = (int) hno.charAt(hno.length() - 1);
|
||||
int fch = (int) fname.charAt(fname.length() - 1);
|
||||
int sch = sname.charAt(sname.length() - 1);
|
||||
if (fch == sch) {
|
||||
return -1;
|
||||
}
|
||||
float res = ((float) hint - fch) / (((float) sch - fch));
|
||||
if (res > 1 || res < -1) {
|
||||
return -1;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
if (num >= numB) {
|
||||
if (fname.contains("-") && sname == null) {
|
||||
int l = fname.indexOf('-');
|
||||
sname = fname.substring(l + 1, fname.length());
|
||||
|
|
Loading…
Reference in a new issue