Skip to content

Commit

Permalink
fixing bug in /ratio computation
Browse files Browse the repository at this point in the history
where giving 2 or 3 OSM types in types2 parameter were throwing an exception
  • Loading branch information
FabiKo117 committed Jul 26, 2019
1 parent 886c1cf commit 16aec32
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,6 @@ public static Response executeCountLengthPerimeterAreaShareRatio(RequestResource
mapRed = inputProcessor.processParameters();
ProcessingData processingData = inputProcessor.getProcessingData();
RequestParameters requestParameters = processingData.getRequestParameters();
ExecutionUtils exeUtils = new ExecutionUtils(processingData);
TagTranslator tt = DbConnData.tagTranslator;
String[] keys2 = inputProcessor.splitParamOnComma(
inputProcessor.createEmptyArrayIfNull(servletRequest.getParameterValues("keys2")));
Expand Down Expand Up @@ -889,7 +888,8 @@ public static Response executeCountLengthPerimeterAreaShareRatio(RequestResource
EnumSet<OSMType> osmTypes1 =
(EnumSet<OSMType>) inputProcessor.getProcessingData().getOsmTypes();
if (!isShare) {
inputProcessor.defineTypes(servletRequest.getParameterValues("types2"), mapRed);
inputProcessor.defineTypes(
inputProcessor.splitParamOnComma(servletRequest.getParameterValues("types2")), mapRed);
}
EnumSet<OSMType> osmTypes2 =
(EnumSet<OSMType>) inputProcessor.getProcessingData().getOsmTypes();
Expand Down Expand Up @@ -938,6 +938,7 @@ public static Response executeCountLengthPerimeterAreaShareRatio(RequestResource
return null;
}, Arrays.asList(MatchType.MATCHESBOTH, MatchType.MATCHES1, MatchType.MATCHES2));
SortedMap<OSHDBCombinedIndex<OSHDBTimestamp, MatchType>, ? extends Number> result = null;
ExecutionUtils exeUtils = new ExecutionUtils(processingData);
result = exeUtils.computeResult(requestResource, preResult);
int resultSize = result.size();
Double[] value1 = new Double[resultSize / 3];
Expand Down

0 comments on commit 16aec32

Please sign in to comment.