diff --git a/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/executor/ExecutionUtils.java b/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/executor/ExecutionUtils.java index a4ecdff0..5452fcb5 100644 --- a/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/executor/ExecutionUtils.java +++ b/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/executor/ExecutionUtils.java @@ -153,11 +153,11 @@ public boolean snapshotMatches(OSMEntitySnapshot snapshot, Set osmTypes } if (!simpleFeatureTypes.isEmpty()) { boolean[] simpleFeatures = setRequestedSimpleFeatures(simpleFeatureTypes); - return matchesTags && ((simpleFeatures[0] && snapshot.getGeometry() instanceof Puntal) - || (simpleFeatures[1] && snapshot.getGeometry() instanceof Lineal) - || (simpleFeatures[2] && snapshot.getGeometry() instanceof Polygonal) - || (simpleFeatures[3] - && "GeometryCollection".equalsIgnoreCase(snapshot.getGeometry().getGeometryType()))); + return matchesTags && simpleFeatures[0] && snapshot.getGeometry() instanceof Puntal + || simpleFeatures[1] && snapshot.getGeometry() instanceof Lineal + || simpleFeatures[2] && snapshot.getGeometry() instanceof Polygonal + || simpleFeatures[3] + && "GeometryCollection".equalsIgnoreCase(snapshot.getGeometry().getGeometryType()); } return matchesTags; } @@ -277,7 +277,7 @@ public void writeCsvResponse(GroupByObject[] resultSet, HttpServletResponse serv } } else { rows = createCsvResponseForElementsRatioGroupBy(resultSet); - } + } writer.writeNext(rows.getLeft().toArray(new String[rows.getLeft().size()]), false); writer.writeAll(rows.getRight(), false); writer.close(); @@ -620,11 +620,11 @@ public ElementsResult[] fillElementsResult(SortedMap results[count] = new UsersResult(TimestampFormatter.getInstance().isoDateTime(entry.getKey()), toTimestamps[count + 1], Double.parseDouble( - df.format((entry.getValue().doubleValue() / (Geo.areaOf(geom) / 1000000))))); + df.format(entry.getValue().doubleValue() / (Geo.areaOf(geom) / 1000000)))); } else { results[count] = new UsersResult( TimestampFormatter.getInstance().isoDateTime(entry.getKey()), toTimestamps[count + 1], diff --git a/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/inputprocessing/InputProcessingUtils.java b/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/inputprocessing/InputProcessingUtils.java index c85a76b7..968cdc32 100644 --- a/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/inputprocessing/InputProcessingUtils.java +++ b/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/inputprocessing/InputProcessingUtils.java @@ -68,8 +68,8 @@ public String findEpsg(double lon, double lat) { zoneNumber = 37; } } - String isNorth = (lat > 0) ? "6" : "7"; - String zone = (zoneNumber < 10) ? "0" + zoneNumber : "" + zoneNumber; + String isNorth = lat > 0 ? "6" : "7"; + String zone = zoneNumber < 10 ? "0" + zoneNumber : "" + zoneNumber; return "EPSG:32" + isNorth + zone; } @@ -369,11 +369,11 @@ public MapReducer filterOnPlanarRelations(MapRe */ public boolean checkGeometryOnSimpleFeatures(Geometry geom, Set simpleFeatureTypes) { - return (simpleFeatureTypes.contains(SimpleFeatureType.POLYGON) && geom instanceof Polygonal) - || (simpleFeatureTypes.contains(SimpleFeatureType.POINT) && geom instanceof Puntal) - || (simpleFeatureTypes.contains(SimpleFeatureType.LINE) && geom instanceof Lineal) - || (simpleFeatureTypes.contains(SimpleFeatureType.OTHER) - && GEOMCOLLTYPE.equalsIgnoreCase(geom.getGeometryType())); + return simpleFeatureTypes.contains(SimpleFeatureType.POLYGON) && geom instanceof Polygonal + || simpleFeatureTypes.contains(SimpleFeatureType.POINT) && geom instanceof Puntal + || simpleFeatureTypes.contains(SimpleFeatureType.LINE) && geom instanceof Lineal + || simpleFeatureTypes.contains(SimpleFeatureType.OTHER) + && GEOMCOLLTYPE.equalsIgnoreCase(geom.getGeometryType()); } /** diff --git a/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/inputprocessing/InputProcessor.java b/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/inputprocessing/InputProcessor.java index 36d6853d..e943b066 100644 --- a/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/inputprocessing/InputProcessor.java +++ b/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/inputprocessing/InputProcessor.java @@ -349,7 +349,7 @@ public void checkKeysValues(String[] keys, String[] values) throws BadRequestExc */ public boolean compareKeysValues(String[] keys, String[] keys2, String[] values, String[] values2) { - return (Arrays.equals(keys, keys2) && Arrays.equals(values, values2)); + return Arrays.equals(keys, keys2) && Arrays.equals(values, values2); } /** Used in /ratio requests. */ diff --git a/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/utils/RequestUtils.java b/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/utils/RequestUtils.java index 6a15b8a5..465622f0 100644 --- a/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/utils/RequestUtils.java +++ b/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/utils/RequestUtils.java @@ -62,8 +62,8 @@ public static boolean cacheNotAllowed(String url, String[] timeParameter) { * @return whether it is a data-extraction request, or not */ public static boolean isDataExtraction(String url) { - return (url.contains("elementsFullHistory") || url.contains("elements/geometry") - || url.contains("elements/centroid") || url.contains("elements/bbox")); + return url.contains("elementsFullHistory") || url.contains("elements/geometry") + || url.contains("elements/centroid") || url.contains("elements/bbox"); } /** @@ -134,7 +134,7 @@ private static boolean usesDefaultToTimestamp(String[] timeParameter) { if (length != 1) { return false; } - return (timeParameter[0].contains("//") || timeParameter[0].endsWith("/")); + return timeParameter[0].contains("//") || timeParameter[0].endsWith("/"); } /**