diff --git a/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/AggregateRequestExecutor.java b/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/AggregateRequestExecutor.java index a4fdc522..62024409 100644 --- a/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/AggregateRequestExecutor.java +++ b/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/AggregateRequestExecutor.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Optional; import java.util.SortedMap; import java.util.function.Consumer; import java.util.stream.Collectors; @@ -25,6 +26,7 @@ import org.heigit.bigspatialdata.oshdb.util.OSHDBTimestamp; import org.heigit.bigspatialdata.oshdb.util.geometry.Geo; import org.heigit.bigspatialdata.oshdb.util.time.TimestampFormatter; +import org.heigit.ohsome.filter.FilterExpression; import org.heigit.ohsome.ohsomeapi.Application; import org.heigit.ohsome.ohsomeapi.exception.BadRequestException; import org.heigit.ohsome.ohsomeapi.exception.ExceptionMessages; @@ -351,6 +353,10 @@ private ElementsResult[] fillElementsResult(SortedMap filter = processingData.getFilterExpression(); + if (filter.isPresent()) { + mapAgg = mapAgg.filter(filter.get()); + } preResult = mapAgg.map(OSMEntitySnapshot::getGeometry); switch (requestResource) { case COUNT: diff --git a/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/ElementsRequestExecutor.java b/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/ElementsRequestExecutor.java index 653a83cb..7f5aa0c2 100644 --- a/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/ElementsRequestExecutor.java +++ b/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/ElementsRequestExecutor.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Optional; import java.util.Set; import java.util.SortedMap; import java.util.TreeMap; @@ -191,6 +192,10 @@ public static

Response aggregateGroupByBoundary if (processingData.isContainingSimpleFeatureTypes()) { mapAgg = inputProcessor.filterOnSimpleFeatures(mapAgg); } + Optional filter = processingData.getFilterExpression(); + if (filter.isPresent()) { + mapAgg = mapAgg.filter(filter.get()); + } ExecutionUtils exeUtils = new ExecutionUtils(processingData); var preResult = mapAgg.map(f -> exeUtils.mapSnapshotToTags(keysInt, valuesInt, f)) .aggregateBy(Pair::getKey, zeroFill).map(Pair::getValue) diff --git a/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/UsersRequestExecutor.java b/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/UsersRequestExecutor.java index 38717916..9b2b0a49 100644 --- a/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/UsersRequestExecutor.java +++ b/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/UsersRequestExecutor.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Optional; import java.util.SortedMap; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -22,6 +23,7 @@ import org.heigit.bigspatialdata.oshdb.osm.OSMType; import org.heigit.bigspatialdata.oshdb.util.OSHDBTimestamp; import org.heigit.bigspatialdata.oshdb.util.tagtranslator.TagTranslator; +import org.heigit.ohsome.filter.FilterExpression; import org.heigit.ohsome.ohsomeapi.Application; import org.heigit.ohsome.ohsomeapi.exception.BadRequestException; import org.heigit.ohsome.ohsomeapi.exception.ExceptionMessages; @@ -313,6 +315,10 @@ public static

Response countGroupByBoundary( if (processingData.isContainingSimpleFeatureTypes()) { mapAgg = inputProcessor.filterOnSimpleFeatures(mapAgg); } + Optional filter = processingData.getFilterExpression(); + if (filter.isPresent()) { + mapAgg = mapAgg.filter(filter.get()); + } SortedMap, Integer> result = mapAgg.map(OSMContribution::getContributorUserId).countUniq(); SortedMap> groupByResult;