Skip to content

Commit

Permalink
Fix sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendrik Leuschner committed Apr 28, 2021
1 parent 675a2b8 commit 8da9b8b
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public class FastIsochroneMapBuilder implements IsochroneMapBuilder {
private double visitorThreshold = 0.0013;
private int minEdgeLengthLimit = 100;
private int maxEdgeLengthLimit = Integer.MAX_VALUE;
private final boolean BUFFERED_OUTPUT = true;
private final double activeCellApproximationFactor = 0.99;
private static final boolean bufferedOutput = true;
private static final double activeCellApproximationFactor = 0.99;

/*
Calculates the distance between two coordinates in meters
Expand Down Expand Up @@ -209,9 +209,6 @@ public IsochroneMap compute(IsochroneSearchParameters parameters) throws Excepti
List<Coordinate> isoPoints = new ArrayList<>((int) (1.2 * edgeMap.getMap().size()));

double isoValue = parameters.getRanges()[i];
double isochronesDifference = parameters.getRanges()[i];
// if (i > 0)
// isochronesDifference = parameters.getRanges()[i] - parameters.getRanges()[i - 1];

float smoothingFactor = parameters.getSmoothingFactor();
TravelRangeType isochroneType = parameters.getRangeType();
Expand All @@ -233,15 +230,13 @@ public IsochroneMap compute(IsochroneSearchParameters parameters) throws Excepti
buildActiveCellsConcaveHulls(fastIsochroneAlgorithm, isochroneGeometries, snappedLoc, snappedPosition, isoValue, maxRadius, smoothingFactor);



if (!isochroneGeometries.isEmpty()) {
//Make a union of all now existing polygons to reduce coordinate list
//Uncomment to see all geometries in response
// for(Geometry poly : isochroneGeometries)
// isochroneMap.addIsochrone(new Isochrone(poly, isoValue, meanRadius));
//for(Geometry poly : isochroneGeometries)
// isochroneMap.addIsochrone(new Isochrone(poly, isoValue, meanRadius));
Geometry preprocessedGeometry = combineGeometries(isochroneGeometries);


StopWatch finalConcaveHullStopWatch = new StopWatch();
if (DebugUtility.isDebug())
finalConcaveHullStopWatch.start();
Expand All @@ -252,7 +247,6 @@ public IsochroneMap compute(IsochroneSearchParameters parameters) throws Excepti
LOGGER.debug("Build final concave hull from " + points.getNumGeometries() + " points: " + finalConcaveHullStopWatch.stop().getSeconds());
}
}
// prevCost = isoValue;
}

if (DebugUtility.isDebug())
Expand Down Expand Up @@ -617,7 +611,7 @@ private void addEdgeCaseGeometry(EdgeIteratorState iter, Quadtree qtree, List<Co

distPolyline += dcFast.calcDist(lat0, lon0, lat1, lon1);

if (BUFFERED_OUTPUT) {
if (bufferedOutput) {
double distCost = minCost + distPolyline * costPerMeter;
if (distCost >= isolineCost) {
double segLength = (1 - (distCost - isolineCost) / edgeCost);
Expand Down

0 comments on commit 8da9b8b

Please sign in to comment.