From c5284ef8113bf7bb4b6a42828a26e0abce11a2e9 Mon Sep 17 00:00:00 2001 From: Jonathan Zeller Date: Mon, 20 Jan 2025 19:25:05 +0100 Subject: [PATCH] sonarqube --- src/engine/SpatialJoinAlgorithms.cpp | 10 +++++----- src/engine/SpatialJoinAlgorithms.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/engine/SpatialJoinAlgorithms.cpp b/src/engine/SpatialJoinAlgorithms.cpp index 5576aa13cb..6ac16d848d 100644 --- a/src/engine/SpatialJoinAlgorithms.cpp +++ b/src/engine/SpatialJoinAlgorithms.cpp @@ -73,7 +73,7 @@ Id SpatialJoinAlgorithms::computeDist(const IdTable* idTableLeft, // gets printed at another place and the point/area just gets skipped return std::nullopt; } - if (useMidpointForAreas) { + if (useMidpointForAreas_) { Point p = calculateMidpointOfBox(areaBox); return GeoPoint(p.get<1>(), p.get<0>()); } else { @@ -300,7 +300,8 @@ std::vector SpatialJoinAlgorithms::computeBoundingBox( auto archaversine = [](double theta) { return std::acos(1 - 2 * theta); }; // safety buffer for numerical inaccuracies - double maxDistInMetersBuffer = maxDist.value() + additionalDist; + double maxDistInMetersBuffer = + static_cast(maxDist.value()) + additionalDist; if (maxDistInMetersBuffer < 10) { maxDistInMetersBuffer = 10; } else if (static_cast(maxDist.value()) < @@ -545,9 +546,8 @@ Result SpatialJoinAlgorithms::BoundingBoxAlgorithm() { std::string warning = "The input to a spatial join contained at least one element, " "that is not a point or polygon geometry and is thus skipped. Note " - "that " - "QLever currently only accepts point or polygon geometries for the " - "spatial joins"; + "that QLever currently only accepts point or polygon geometries for " + "the spatial joins"; AD_LOG_WARN << warning << std::endl; alreadyWarned = true; if (spatialJoin.has_value()) { diff --git a/src/engine/SpatialJoinAlgorithms.h b/src/engine/SpatialJoinAlgorithms.h index 8efd250ad6..28bf302a6f 100644 --- a/src/engine/SpatialJoinAlgorithms.h +++ b/src/engine/SpatialJoinAlgorithms.h @@ -151,7 +151,7 @@ class SpatialJoinAlgorithms { // if the distance calculation should be approximated, by the midpoint of // the area - bool useMidpointForAreas = true; + bool useMidpointForAreas_ = true; // circumference in meters at the equator (max) and the pole (min) (as the // earth is not exactly a sphere the circumference is different. Note that