diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a27e940..f9c9f1d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,21 @@ +## 1.3.1 + +### Bug Fixes + +* fix crash when `elementsFullHistory` requests use the `filter` parameter ([#97]) +* fix a bug where `groupBy/boundary` requests do ignore a given `filter` ([#99]) +* update to OSHDB version 0.6.2, fixing a crash when building certain invalid multipolygon relations ([OSHDB#334]) + +[#97]: https://github.com/GIScience/ohsome-api/pull/97 +[#99]: https://github.com/GIScience/ohsome-api/issues/99 +[OSHDB#334]: https://github.com/GIScience/oshdb/issues/334 + + ## 1.3.0 ### Prominent Changes -* update OSHDB to version 0.6.0 ([#86]) +* update OSHDB to version 0.6.1 ([#86]) * returned values of `length`, `area` and `perimeter` requests are more precise now: The previously used formulas could be off by a few of % in some cases, now all returned values are within half a percent from the real value. ([OSHDB#193]) * adjusted unit tests accordingly, from now on allowing up to 0.5% discrepancy in all affected tests * improved performance of `groupBy/boundary` requests ([OSHDB#272]) and processing of complex multipolygon relations ([OSHDB#249] and [OSHDB#287]) @@ -35,6 +48,8 @@ ## 1.2.2 +### Bug Fixes + * provide contributions response as a downloadable file ([#78]) [#78]: https://github.com/GIScience/ohsome-api/pull/78 @@ -51,7 +66,7 @@ ## 1.2.0 -### Prominent Changes +### Prominent Changes * several improvements to the docs (e.g. [#49] and partially in [#34]) * upgrade to ohsome-filter 1.3 ([#62]) diff --git a/README.md b/README.md index e57c4af7..f3512fdc 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The ohsome API is a generic web API for in-depth analysis of OpenStreetMap (OSM) data with a focus on it's history. It allows to get aggregated statistics about the evolution of OSM data itself and about the contributors behind the data. Furthermore, data extraction methods are provided to access the historic development of individual OSM features. -The functionalities of the ohsome API can be accessed via HTTP requests. As a basis underneath serves the [OSHDB API](https://github.com/GIScience/oshdb). The current stable version is [v1.3.0](https://github.com/GIScience/ohsome-api/releases/tag/1.3.0). Developed and maintained by [HeiGIT](https://heigit.org/). +The functionalities of the ohsome API can be accessed via HTTP requests. As a basis underneath serves the [OSHDB API](https://github.com/GIScience/oshdb). The current stable version is [v1.3.1](https://github.com/GIScience/ohsome-api/releases/tag/1.3.1). Developed and maintained by [HeiGIT](https://heigit.org/). ## Using the ohsome API @@ -38,8 +38,8 @@ These instructions will get you a copy of the project up and running on your loc 2. move to your Maven project directory in a shell (e.g. Windows PowerShell) 3. enter the command `mvn -DskipTests=true package` to build the project (if you want to build it running the integrated tests too, look at the section [Testing](#testing)) 4. to run the jar file enter the following (if no additional keytables file is given, you can assume that it is included): - * keytables included: `java -jar target/ohsome-api-1.3.0.jar --database.db=C:/path-to-your-data/ba-wue.oshdb` - * keytables not included: `java -jar target/ohsome-api-1.3.0.jar --database.db=C:/path-to-your-data/ba-wue.oshdb --database.keytables=C:/path-to-your-keytablesFile/keytables` + * keytables included: `java -jar target/ohsome-api-1.3.1.jar --database.db=C:/path-to-your-data/ba-wue.oshdb` + * keytables not included: `java -jar target/ohsome-api-1.3.1.jar --database.db=C:/path-to-your-data/ba-wue.oshdb --database.keytables=C:/path-to-your-keytablesFile/keytables` Now you should have a running local API, which is ready for receiving requests under *http://localhost:8080/*.
To check if it is running properly, you should be able to visit the swagger documentation under *http://localhost:8080/swagger-ui.html*. @@ -97,7 +97,7 @@ Here you see an example response giving the length of residential roads for a bo "url": "https://ohsome.org/copyrights", "text": "© OpenStreetMap contributors" }, - "apiVersion": "1.3.0", + "apiVersion": "1.3.1", "metadata": { "executionTime": 858, "description": "Total length of items in meters.", diff --git a/docs/endpoints.rst b/docs/endpoints.rst index ad211989..df585b0b 100644 --- a/docs/endpoints.rst +++ b/docs/endpoints.rst @@ -78,7 +78,7 @@ How big is the area of farmland in the region Rhein-Neckar? "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "result" : [ { "timestamp" : "2014-01-01T00:00:00Z", "value" : 1.020940258E7 @@ -92,7 +92,7 @@ How big is the area of farmland in the region Rhein-Neckar? "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "result" : [ { "timestamp" : "2014-01-01T00:00:00Z", "value" : 1.020940258E7 @@ -107,7 +107,7 @@ How big is the area of farmland in the region Rhein-Neckar? "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "result" : [ { "timestamp" : "2014-01-01T00:00:00Z", "value" : 10209402.58 @@ -121,7 +121,7 @@ How big is the area of farmland in the region Rhein-Neckar? "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "result" : [ { "timestamp" : "2014-01-01T00:00:00Z", "value" : 1.020940258E7 @@ -175,7 +175,7 @@ What is the density of restaurants with wheelchair access in Heidelberg? "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "result" : [ { "timestamp" : "2019-05-07T00:00:00Z", "value" : 0.79 @@ -189,7 +189,7 @@ What is the density of restaurants with wheelchair access in Heidelberg? "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "result" : [ { "timestamp" : "2019-05-07T00:00:00Z", "value" : 0.79 @@ -204,7 +204,7 @@ What is the density of restaurants with wheelchair access in Heidelberg? "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "result" : [ { "timestamp" : "2019-05-07T00:00:00Z", "value" : 0.79 @@ -218,7 +218,7 @@ What is the density of restaurants with wheelchair access in Heidelberg? "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "result" : [ { "timestamp" : "2019-05-07T00:00:00Z", "value" : 0.79 @@ -276,7 +276,7 @@ How many oneway streets exist within living_street streets in Heidelberg over ti "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "ratioResult" : [ { "timestamp" : "2016-01-01T00:00:00Z", "value" : 28660.519999999997, @@ -303,7 +303,7 @@ How many oneway streets exist within living_street streets in Heidelberg over ti "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "ratioResult" : [ { "timestamp" : "2016-01-01T00:00:00Z", "value" : 28660.519999999997, @@ -331,7 +331,7 @@ How many oneway streets exist within living_street streets in Heidelberg over ti "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "ratioResult" : [ { "timestamp" : "2016-01-01T00:00:00Z", "value" : 28660.519999999997, @@ -357,7 +357,7 @@ How many oneway streets exist within living_street streets in Heidelberg over ti "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "ratioResult" : [ { "timestamp" : "2016-01-01T00:00:00Z", "value" : 28660.519999999997, @@ -436,7 +436,7 @@ How often information about the roof of buildings is present? "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "groupByResult" : [ { "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", @@ -466,7 +466,7 @@ How often information about the roof of buildings is present? "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "groupByResult" : [ { "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", @@ -495,7 +495,7 @@ How often information about the roof of buildings is present? "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "groupByResult" : [ { "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", @@ -524,7 +524,7 @@ How often information about the roof of buildings is present? "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "groupByResult" : [ { "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", @@ -608,7 +608,7 @@ Compare length of different types of streets for two or more regions. "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "groupByResult" : [ { "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", @@ -668,7 +668,7 @@ Compare length of different types of streets for two or more regions. "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "groupByResult" : [ { "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", @@ -727,7 +727,7 @@ Compare length of different types of streets for two or more regions. "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "groupByResult" : [ { "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", @@ -786,7 +786,7 @@ Compare length of different types of streets for two or more regions. "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "groupByResult" : [ { "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", @@ -901,7 +901,7 @@ Show number of users editing buildings before, during and after Nepal earthquake "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "result" : [ { "fromTimestamp" : "2015-03-01T00:00:00Z", "toTimestamp" : "2015-04-01T00:00:00Z", @@ -933,7 +933,7 @@ Show number of users editing buildings before, during and after Nepal earthquake "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "result" : [ { "fromTimestamp" : "2015-03-01T00:00:00Z", "toTimestamp" : "2015-04-01T00:00:00Z", @@ -965,7 +965,7 @@ Show number of users editing buildings before, during and after Nepal earthquake "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "result" : [ { "fromTimestamp" : "2015-03-01T00:00:00Z", "toTimestamp" : "2015-04-01T00:00:00Z", @@ -996,7 +996,7 @@ Show number of users editing buildings before, during and after Nepal earthquake "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "result" : [ { "fromTimestamp" : "2015-03-01T00:00:00Z", "toTimestamp" : "2015-04-01T00:00:00Z", @@ -1142,7 +1142,7 @@ Extract the modifications of the blown up tower of the heidelberg castle over ti "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "type" : "FeatureCollection", "features" : [{ "type" : "Feature", @@ -1180,7 +1180,7 @@ Extract the modifications of the blown up tower of the heidelberg castle over ti "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "type" : "FeatureCollection", "features" : [{ "type" : "Feature", @@ -1219,7 +1219,7 @@ Extract the modifications of the blown up tower of the heidelberg castle over ti "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "type" : "FeatureCollection", "features" : [{ "type" : "Feature", @@ -1257,7 +1257,7 @@ Extract the modifications of the blown up tower of the heidelberg castle over ti "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "type" : "FeatureCollection", "features" : [{ "type" : "Feature", @@ -1338,7 +1338,7 @@ Get the changes of pharmacies with opening hours in a certain area of Heidelberg "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "metadata" : { "description" : "Latest contributions as GeoJSON features.", "requestUrl" : "https://api.ohsome.org/v1/contributions/latest/geometry?bboxes=8.6720,49.3988,8.7026,49.4274&filter=amenity=pharmacy%20and%20opening_hours=*%20and%20type:node&time=2020-02-01,2020-06-29&showMetadata=yes&properties=metadata,tags&clipGeometry=false" @@ -1414,7 +1414,7 @@ Get the changes of pharmacies with opening hours in a certain area of Heidelberg "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "metadata" : { "description" : "Latest contributions as GeoJSON features.", "requestUrl" : "https://api.ohsome.org/v1/contributions/latest/geometry?bboxes=8.6720,49.3988,8.7026,49.4274&filter=amenity=pharmacy%20and%20opening_hours=*%20and%20type:node&time=2020-02-01,2020-06-29&showMetadata=yes&properties=metadata,tags&clipGeometry=false" @@ -1490,7 +1490,7 @@ Get the changes of pharmacies with opening hours in a certain area of Heidelberg "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "metadata" : { "description" : "Latest contributions as GeoJSON features.", "requestUrl" : "https://api.ohsome.org/v1/contributions/latest/geometry?bboxes=8.6720,49.3988,8.7026,49.4274&filter=amenity=pharmacy%20and%20opening_hours=*%20and%20type:node&time=2020-02-01,2020-06-29&showMetadata=yes&properties=metadata,tags&clipGeometry=false" @@ -1566,7 +1566,7 @@ Get the changes of pharmacies with opening hours in a certain area of Heidelberg "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "metadata" : { "description" : "Latest contributions as GeoJSON features.", "requestUrl" : "https://api.ohsome.org/v1/contributions/latest/geometry?bboxes=8.6720,49.3988,8.7026,49.4274&filter=amenity=pharmacy%20and%20opening_hours=*%20and%20type:node&time=2020-02-01,2020-06-29&showMetadata=yes&properties=metadata,tags&clipGeometry=false" @@ -1680,7 +1680,7 @@ Get the latest change of constructions in a certain area of the Bahnstadt in Hei "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "metadata" : { "description" : "Latest contributions as GeoJSON features.", "requestUrl" : "https://api.ohsome.org/v1/contributions/latest/geometry?bboxes=8.6644159,49.401099,8.6663353,49.4027195&filter=landuse=construction%20and%20type:way&time=2020-06-29,2014-07-01&showMetadata=yes&properties=metadata,tags&clipGeometry=false" @@ -1731,7 +1731,7 @@ Get the latest change of constructions in a certain area of the Bahnstadt in Hei "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "metadata" : { "description" : "Latest contributions as GeoJSON features.", "requestUrl" : "https://api.ohsome.org/v1/contributions/latest/geometry?bboxes=8.6644159,49.401099,8.6663353,49.4027195&filter=landuse=construction%20and%20type:way&time=2020-06-29,2014-07-01&showMetadata=yes&properties=metadata,tags&clipGeometry=false" @@ -1782,7 +1782,7 @@ Get the latest change of constructions in a certain area of the Bahnstadt in Hei "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "metadata" : { "description" : "Latest contributions as GeoJSON features.", "requestUrl" : "https://api.ohsome.org/v1/contributions/latest/geometry?bboxes=8.6644159,49.401099,8.6663353,49.4027195&filter=landuse=construction%20and%20type:way&time=2020-06-29,2014-07-01&showMetadata=yes&properties=metadata,tags&clipGeometry=false" @@ -1833,7 +1833,7 @@ Get the latest change of constructions in a certain area of the Bahnstadt in Hei "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "metadata" : { "description" : "Latest contributions as GeoJSON features.", "requestUrl" : "https://api.ohsome.org/v1/contributions/latest/geometry?bboxes=8.6644159,49.401099,8.6663353,49.4027195&filter=landuse=construction%20and%20type:way&time=2020-06-29,2014-07-01&showMetadata=yes&properties=metadata,tags&clipGeometry=false" @@ -1918,7 +1918,7 @@ Get metadata of the underlying OSHDB data "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "timeout": 600.0, "extractRegion" : { "spatialExtent" : { @@ -1940,7 +1940,7 @@ Get metadata of the underlying OSHDB data "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "extractRegion" : { "spatialExtent" : { "type" : "Polygon", @@ -1961,7 +1961,7 @@ Get metadata of the underlying OSHDB data "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, - "apiVersion" : "1.3.0", + "apiVersion" : "1.3.1", "extractRegion" : { "spatialExtent" : { "type" : "Polygon", diff --git a/pom.xml b/pom.xml index 3f69bcb1..d2e6b8b6 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ ohsome API A public Web-RESTful-API for "ohsome" OpenStreetMap history data. jar - 1.3.0 + 1.3.1 1.6 @@ -29,7 +29,7 @@ 0.13.0 3.2.0 4.0 - 0.6.1 + 0.6.2 1.18.16 2.0.3.RELEASE 2.9.2 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/DataRequestExecutor.java b/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/DataRequestExecutor.java index 2a1777f6..d47749fc 100644 --- a/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/DataRequestExecutor.java +++ b/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/DataRequestExecutor.java @@ -101,9 +101,10 @@ public void extract() throws Exception { String endTimestamp = IsoDateTimeParser.parseIsoDateTime(requestParameters.getTime()[1]) .format(DateTimeFormatter.ISO_DATE_TIME); MapReducer> mapRedContributions = mapRedContribution.groupByEntity(); + MapReducer> mapRedSnapshots = mapRedSnapshot.groupByEntity(); Optional filter = processingData.getFilterExpression(); if (filter.isPresent()) { - mapRedSnapshot = mapRedSnapshot.filter(filter.get()); + mapRedSnapshots = mapRedSnapshots.filter(filter.get()); mapRedContributions = mapRedContributions.filter(filter.get()); } final boolean isContainingSimpleFeatureTypes = processingData.isContainingSimpleFeatureTypes(); @@ -124,8 +125,7 @@ public void extract() throws Exception { MapReducer snapshotPreResult = null; if (!isContributionsEndpoint) { // handles cases where valid_from = t_start, valid_to = t_end; i.e. non-modified data - snapshotPreResult = mapRedSnapshot - .groupByEntity() + snapshotPreResult = mapRedSnapshots .filter(snapshots -> snapshots.size() == 2) .filter(snapshots -> snapshots.get(0).getGeometry() == snapshots.get(1).getGeometry() && snapshots.get(0).getEntity().getVersion() == snapshots.get(1).getEntity() 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;