diff --git a/src/main/java/de/rondiplomatico/nds/NDSEnvelope.java b/src/main/java/de/rondiplomatico/nds/NDSEnvelope.java index cda7555..eb1a834 100644 --- a/src/main/java/de/rondiplomatico/nds/NDSEnvelope.java +++ b/src/main/java/de/rondiplomatico/nds/NDSEnvelope.java @@ -47,40 +47,40 @@ public NDSCoordinate getNorthWest() { } public int[] getMasterTileInfo(int maxLevels) { - NDSCoordinate point0 = getSouthWest(); - NDSCoordinate point1 = getSouthEast(); - NDSCoordinate point2 = getNorthEast(); - NDSCoordinate point3 = getNorthWest(); + NDSCoordinate point0 = getSouthWest(); + NDSCoordinate point1 = getSouthEast(); + NDSCoordinate point2 = getNorthEast(); + NDSCoordinate point3 = getNorthWest(); return getMasterTileInfo(point0, point1, point2, point3, maxLevels); } public int[] getMasterTileInfo(NDSCoordinate point0, NDSCoordinate point1, NDSCoordinate point2, NDSCoordinate point3, int maxLevels) { int masterTileLevel = -1; - int masterTileID = -1; + int masterTileID = -1; for (int li = 0; li < maxLevels; li++) { - NDSTile currTile0 = new NDSTile(li, point0); - NDSTile currTile1 = new NDSTile(li, point1); - NDSTile currTile2 = new NDSTile(li, point2); - NDSTile currTile3 = new NDSTile(li, point3); + NDSTile currTile0 = new NDSTile(li, point0); + NDSTile currTile1 = new NDSTile(li, point1); + NDSTile currTile2 = new NDSTile(li, point2); + NDSTile currTile3 = new NDSTile(li, point3); int currTileID0 = currTile0.getTileNumber(); int currTileID1 = currTile1.getTileNumber(); int currTileID2 = currTile2.getTileNumber(); int currTileID3 = currTile3.getTileNumber(); - boolean singleTileID = (currTileID0 == currTileID1) && (currTileID0 == currTileID2) && (currTileID0 == currTileID3); + boolean singleTileID = (currTileID0 == currTileID1) && (currTileID0 == currTileID2) && (currTileID0 == currTileID3); // if at least one tile ID is different, we discard the tile IDs and keep our previously detected tile ID (i.e. on the previous level) if(!singleTileID) { break; } // store tile info masterTileLevel = li; - masterTileID = currTileID0; + masterTileID = currTileID0; } // check if valid result if (masterTileID == -1) { System.out.println(">>>ERROR: Invalid master tile ID."); System.exit(1); } - int[] masterTileInfo = {masterTileLevel, masterTileID}; + int[] masterTileInfo = {masterTileLevel, masterTileID}; return masterTileInfo; } } \ No newline at end of file diff --git a/src/main/java/de/rondiplomatico/nds/polygon.java b/src/main/java/de/rondiplomatico/nds/polygon.java index bff0566..8865b73 100644 --- a/src/main/java/de/rondiplomatico/nds/polygon.java +++ b/src/main/java/de/rondiplomatico/nds/polygon.java @@ -247,18 +247,18 @@ public static double[][] refinePolygon(int level, double[][] polygonCoordinates, public static int[] getTileNumbersOnLevel(int level, double[][] polygonCoordinates){ int numCoord = polygonCoordinates.length; - int[] tileNumbers = new int[numCoord]; + int[] tileNumbers = new int[numCoord]; // loop over all coordinates to get map tile IDs for (int idx = 0; idx < numCoord; idx++) { - NDSCoordinate currCoord = new NDSCoordinate(polygonCoordinates[idx][1], polygonCoordinates[idx][0]); + NDSCoordinate currCoord = new NDSCoordinate(polygonCoordinates[idx][0], polygonCoordinates[idx][1]); NDSTile currTile = new NDSTile(level, currCoord); - tileNumbers[idx] = currTile.getTileNumber(); + tileNumbers[idx] = currTile.getTileNumber(); } return tileNumbers; } public static int[] getUniqueTileNumbersOnLevel(int level, double[][] polygonCoordinates){ - int[] tileNumbers = getTileNumbersOnLevel(level, polygonCoordinates); + int[] tileNumbers = getTileNumbersOnLevel(level, polygonCoordinates); return IntStream.of(tileNumbers).distinct().toArray(); } }