Skip to content

Commit

Permalink
Fallback region set detection from finnish title
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakarFin committed Nov 17, 2023
1 parent 7ff92cb commit 5140789
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,20 @@ private List<String> getDeclaredRegionsets(JSONObject indicatorClassification) {
}
list.add(sotkaRegionCategory.toLowerCase());
}
if (sotkaRegionsets.length() != 0) {
return list;
}
// empty list of declared region sets
// -> fallback trying to detect region set from classification.region.title.fi
JSONObject titleObj = regionClassification.optJSONObject("title");
if (titleObj == null) {
return list;
}
// finnish service and our regionTypes are finnish so a fair assumption
String finnishTitle = titleObj.optString("fi", null);
if (finnishTitle != null) {
list.add(finnishTitle.toLowerCase());
}
return list;
}

Expand Down

0 comments on commit 5140789

Please sign in to comment.