Skip to content

Commit

Permalink
Merge pull request #902 from ebocher/fix_891
Browse files Browse the repository at this point in the history
Fix  #896
  • Loading branch information
ebocher authored Jan 9, 2024
2 parents 7d04005 + c06571d commit 9b13b3f
Showing 1 changed file with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,24 +177,26 @@ Map formatBuildingLayer(JdbcDataSource datasource, String building, String zone
if(mapTypes.size()==1){
new_type= mapTypes.keySet().stream().findFirst().get()
}else {
String maxKeyType = mapTypes.max { it.value }.key
def sortValues = mapTypes.sort { -it.value }.keySet()
sortValues.remove(maxKeyType)
switch (maxKeyType) {
case "residential":
if (sortValues.contains("education")) {
def maxType = mapTypes.max { it.value }
if(maxType){
String maxKeyType = maxType.key
def sortValues = mapTypes.sort { -it.value }.keySet()
sortValues.remove(maxKeyType)
switch (maxKeyType) {
case "residential":
if (sortValues.contains("education")) {
new_type = "education"
} else {
new_type = sortValues.take(1)[0]
}
break
case "education":
new_type = "education"
}
else {
break
default:
new_type = sortValues.take(1)[0]
}
break
case "education":
new_type="education"
break
default:
new_type = sortValues.take(1)[0]
break
break
}
}

}
Expand Down

0 comments on commit 9b13b3f

Please sign in to comment.