Skip to content

Commit

Permalink
optiize condition
Browse files Browse the repository at this point in the history
  • Loading branch information
DiaZork committed Jan 22, 2025
1 parent 7dbd798 commit 414b605
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/eu/ec/doris/kohesio/controller/MapController.java
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ private HashMap<String, Zone> getCoordinatesByGeographicSubdivision(
uriCount.put(nutsOfCount, count);
}
// 2. take only the nuts that are matching to the zoom level
// if the zoom is smaller than 4 we show the numbers of the whole country
// if the zoom is lower than 6 we show the numbers of the whole country
String query = "";
String type = "";
if (zoom < 6) {
Expand All @@ -889,7 +889,7 @@ private HashMap<String, Zone> getCoordinatesByGeographicSubdivision(
type = "COUNTRY";
}
// if the zoom is between 4 and 9 we show the numbers of the nuts 1 or 2
if (zoom == 6) {
else if (zoom == 6) {
query = "SELECT * WHERE {"
+ " ?s <http://nuts.de/linkedopendata> ?lid . "
+ " ?s <http://nuts.de/geometry> ?geo . "
Expand All @@ -899,7 +899,7 @@ private HashMap<String, Zone> getCoordinatesByGeographicSubdivision(
type = "NUTS1";
}
// if the zoom is between 4 and 9 we show the numbers of the nuts 1 or 2
if (zoom == 7) {
else if (zoom == 7) {
query = "SELECT * WHERE {"
+ " ?s <http://nuts.de/linkedopendata> ?lid . "
+ " ?s <http://nuts.de/geometry> ?geo . "
Expand All @@ -908,8 +908,8 @@ private HashMap<String, Zone> getCoordinatesByGeographicSubdivision(
+ "} ";
type = "NUTS2";
}
// if the zoom is lower than 9 we show the numbers of the nuts 2 or 3
if (zoom >= 8) {
// if the zoom is higher than 9 we show the numbers of the nuts 2 or 3
else {
query = "SELECT * WHERE {"
+ " ?s <http://nuts.de/linkedopendata> ?lid . "
+ " ?s <http://nuts.de/geometry> ?geo . "
Expand Down

0 comments on commit 414b605

Please sign in to comment.