From 91e07cdd148c38a3bef13252519f5ce06c2b889c Mon Sep 17 00:00:00 2001 From: Rosario Trischitta Date: Tue, 9 Feb 2021 16:42:54 +0100 Subject: [PATCH 1/4] style: change objects names in responses --- .../heigit/ohsome/ohsomeapi/executor/ExecutionUtils.java | 4 ++-- .../output/ratio/RatioGroupByBoundaryResponse.java | 6 +++--- .../ohsome/ohsomeapi/output/ratio/RatioGroupByResult.java | 6 +++--- .../heigit/ohsome/ohsomeapi/output/ratio/RatioResponse.java | 2 +- .../ohsomeapi/utils/GroupByBoundaryGeoJsonGenerator.java | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/ExecutionUtils.java b/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/ExecutionUtils.java index 87a1f51bd..cbc1c858b 100644 --- a/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/ExecutionUtils.java +++ b/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/ExecutionUtils.java @@ -773,8 +773,8 @@ private ImmutablePair, List> createCsvResponseForElements columnNames.add(ratioGroupByResult.getGroupByObject() + "_value"); columnNames.add(ratioGroupByResult.getGroupByObject() + "_value2"); columnNames.add(ratioGroupByResult.getGroupByObject() + "_ratio"); - for (int j = 0; j < ratioGroupByResult.getRatioResult().length; j++) { - RatioResult ratioResult = ratioGroupByResult.getRatioResult()[j]; + for (int j = 0; j < ratioGroupByResult.getResult().length; j++) { + RatioResult ratioResult = ratioGroupByResult.getResult()[j]; if (i == 0) { String[] row = new String[resultSet.length * 3 + 1]; row[0] = ratioResult.getTimestamp(); diff --git a/src/main/lombok/org/heigit/ohsome/ohsomeapi/output/ratio/RatioGroupByBoundaryResponse.java b/src/main/lombok/org/heigit/ohsome/ohsomeapi/output/ratio/RatioGroupByBoundaryResponse.java index c5584534d..e4d074761 100644 --- a/src/main/lombok/org/heigit/ohsome/ohsomeapi/output/ratio/RatioGroupByBoundaryResponse.java +++ b/src/main/lombok/org/heigit/ohsome/ohsomeapi/output/ratio/RatioGroupByBoundaryResponse.java @@ -39,14 +39,14 @@ public class RatioGroupByBoundaryResponse implements Response { private Feature[] features; @ApiModelProperty(notes = "RatioGroupByResult array holding the respective objects " + "with their timestamp-value-value2-ratio values", required = true) - private RatioGroupByResult[] groupByBoundaryResult; + private RatioGroupByResult[] groupByResult; public RatioGroupByBoundaryResponse(Attribution attribution, String apiVersion, Metadata metadata, - RatioGroupByResult[] groupByBoundaryResult) { + RatioGroupByResult[] groupByResult) { this.attribution = attribution; this.apiVersion = apiVersion; this.metadata = metadata; - this.groupByBoundaryResult = groupByBoundaryResult; + this.groupByResult = groupByResult; } /** Static factory method returning the whole GeoJSON response. */ diff --git a/src/main/lombok/org/heigit/ohsome/ohsomeapi/output/ratio/RatioGroupByResult.java b/src/main/lombok/org/heigit/ohsome/ohsomeapi/output/ratio/RatioGroupByResult.java index b7d2f56fa..2b3203278 100644 --- a/src/main/lombok/org/heigit/ohsome/ohsomeapi/output/ratio/RatioGroupByResult.java +++ b/src/main/lombok/org/heigit/ohsome/ohsomeapi/output/ratio/RatioGroupByResult.java @@ -14,10 +14,10 @@ public class RatioGroupByResult extends GroupByObject { @ApiModelProperty(notes = "RatioResult array holding timestamp, whole and part values", required = true) - private RatioResult[] ratioResult; + private RatioResult[] result; - public RatioGroupByResult(Object groupByObject, RatioResult[] ratioResult) { + public RatioGroupByResult(Object groupByObject, RatioResult[] result) { super(groupByObject); - this.ratioResult = ratioResult; + this.result = result; } } diff --git a/src/main/lombok/org/heigit/ohsome/ohsomeapi/output/ratio/RatioResponse.java b/src/main/lombok/org/heigit/ohsome/ohsomeapi/output/ratio/RatioResponse.java index 186b4249b..df6e654de 100644 --- a/src/main/lombok/org/heigit/ohsome/ohsomeapi/output/ratio/RatioResponse.java +++ b/src/main/lombok/org/heigit/ohsome/ohsomeapi/output/ratio/RatioResponse.java @@ -29,5 +29,5 @@ public class RatioResponse implements Response { @ApiModelProperty(notes = "Metadata describing the output") private Metadata metadata; @ApiModelProperty(notes = "ElementsResult for /ratio requests", required = true) - private RatioResult[] ratioResult; + private RatioResult[] result; } diff --git a/src/main/lombok/org/heigit/ohsome/ohsomeapi/utils/GroupByBoundaryGeoJsonGenerator.java b/src/main/lombok/org/heigit/ohsome/ohsomeapi/utils/GroupByBoundaryGeoJsonGenerator.java index 096e201d8..f9cc233f5 100644 --- a/src/main/lombok/org/heigit/ohsome/ohsomeapi/utils/GroupByBoundaryGeoJsonGenerator.java +++ b/src/main/lombok/org/heigit/ohsome/ohsomeapi/utils/GroupByBoundaryGeoJsonGenerator.java @@ -38,11 +38,11 @@ private static Feature[] generateRatioGroupByResultGeoJson(GroupByObject[] resul int tstampCount) { Feature[] features; RatioGroupByResult[] groupByResults = (RatioGroupByResult[]) results; - int resultLength = groupByResults[0].getRatioResult().length; + int resultLength = groupByResults[0].getResult().length; int featuresLength = groupByResultsLength * resultLength; features = new Feature[featuresLength]; for (int i = 0; i < featuresLength; i++) { - RatioResult result = groupByResults[groupByResultCount].getRatioResult()[tstampCount]; + RatioResult result = groupByResults[groupByResultCount].getResult()[tstampCount]; String tstamp = result.getTimestamp(); Feature feature = fillGeojsonFeature(results, groupByResultCount, tstamp); feature.setProperty("value", result.getValue()); From 2a10ef38353649826f751351fe25e7122fde073f Mon Sep 17 00:00:00 2001 From: Rosario Trischitta Date: Tue, 9 Feb 2021 16:48:43 +0100 Subject: [PATCH 2/4] test: update objects names --- .../controller/GetControllerTest.java | 21 +++++++++---------- .../controller/PostControllerTest.java | 15 +++++++------ 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/test/java/org/heigit/ohsome/ohsomeapi/controller/GetControllerTest.java b/src/test/java/org/heigit/ohsome/ohsomeapi/controller/GetControllerTest.java index ed247eda5..18d7e92d2 100644 --- a/src/test/java/org/heigit/ohsome/ohsomeapi/controller/GetControllerTest.java +++ b/src/test/java/org/heigit/ohsome/ohsomeapi/controller/GetControllerTest.java @@ -3,7 +3,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assume.assumeTrue; - import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.JsonNodeType; import java.io.IOException; @@ -230,7 +229,7 @@ public void getElementsCountRatioTest() { + "addr:housenumber=*", JsonNode.class); assertEquals(expectedValue, - response.getBody().get("ratioResult").get(0).get("ratio").asDouble(), + response.getBody().get("result").get(0).get("ratio").asDouble(), expectedValue * deltaPercentage); } @@ -246,10 +245,10 @@ public void getElementsCountRatioGroupByBoundaryTest() { assertEquals(expectedValue, StreamSupport .stream( Spliterators.spliteratorUnknownSize( - response.getBody().get("groupByBoundaryResult").iterator(), Spliterator.ORDERED), + response.getBody().get("groupByResult").iterator(), Spliterator.ORDERED), false) .filter(jsonNode -> jsonNode.get("groupByObject").asText().equalsIgnoreCase("boundary1")) - .findFirst().get().get("ratioResult").get(0).get("ratio").asDouble(), + .findFirst().get().get("result").get(0).get("ratio").asDouble(), expectedValue * deltaPercentage); } @@ -438,7 +437,7 @@ public void getElementsLengthRatioTest() { + "&time=2011-12-13&&filter=type:way and highway=*&filter2=railway=*", JsonNode.class); assertEquals(expectedValue, - response.getBody().get("ratioResult").get(0).get("ratio").asDouble(), + response.getBody().get("result").get(0).get("ratio").asDouble(), expectedValue * deltaPercentage); } @@ -454,10 +453,10 @@ public void getElementsLengthRatioGroupByBoundaryTest() { assertEquals(expectedValue, StreamSupport .stream( Spliterators.spliteratorUnknownSize( - response.getBody().get("groupByBoundaryResult").iterator(), Spliterator.ORDERED), + response.getBody().get("groupByResult").iterator(), Spliterator.ORDERED), false) .filter(jsonNode -> jsonNode.get("groupByObject").asText().equalsIgnoreCase("boundary1")) - .findFirst().get().get("ratioResult").get(0).get("ratio").asDouble(), + .findFirst().get().get("result").get(0).get("ratio").asDouble(), expectedValue * deltaPercentage); } @@ -1086,7 +1085,7 @@ public void areaRatioFilterTest() { + "2018-01-01&filter=building=* and type:way&filter2=building=* and type:relation", JsonNode.class); assertEquals(expectedValue, - response.getBody().get("ratioResult").get(0).get("ratio").asDouble(), + response.getBody().get("result").get(0).get("ratio").asDouble(), expectedValue * deltaPercentage); } @@ -1102,10 +1101,10 @@ public void ratioGroupByBoundaryFilterTest() { assertEquals(expectedValue, StreamSupport .stream( Spliterators.spliteratorUnknownSize( - response.getBody().get("groupByBoundaryResult").iterator(), Spliterator.ORDERED), + response.getBody().get("groupByResult").iterator(), Spliterator.ORDERED), false) .filter(jsonNode -> jsonNode.get("groupByObject").asText().equalsIgnoreCase("b2")) - .findFirst().get().get("ratioResult").get(0).get("ratio").asDouble(), + .findFirst().get().get("result").get(0).get("ratio").asDouble(), expectedValue * deltaPercentage); } @@ -1118,7 +1117,7 @@ public void getElementsCountRatioEmptyFilterTest() { + "filter2=highway=*&time=2019-01-01", JsonNode.class); assertEquals(expectedValue, - response.getBody().get("ratioResult").get(0).get("ratio").asDouble(), + response.getBody().get("result").get(0).get("ratio").asDouble(), expectedValue * deltaPercentage); } diff --git a/src/test/java/org/heigit/ohsome/ohsomeapi/controller/PostControllerTest.java b/src/test/java/org/heigit/ohsome/ohsomeapi/controller/PostControllerTest.java index 3aa97b855..d03d3ff76 100644 --- a/src/test/java/org/heigit/ohsome/ohsomeapi/controller/PostControllerTest.java +++ b/src/test/java/org/heigit/ohsome/ohsomeapi/controller/PostControllerTest.java @@ -2,7 +2,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assume.assumeTrue; - import com.fasterxml.jackson.databind.JsonNode; import java.io.IOException; import java.util.Arrays; @@ -385,7 +384,7 @@ public void elementsPerimeterRatioTest() { ResponseEntity response = restTemplate .postForEntity(server + port + "/elements/perimeter/ratio", map, JsonNode.class); assertEquals(expectedValue, - response.getBody().get("ratioResult").get(0).get("ratio").asDouble(), + response.getBody().get("result").get(0).get("ratio").asDouble(), expectedValue * deltaPercentage); } @@ -404,10 +403,10 @@ public void elementsPerimeterRatioGroupByBoundaryTest() { assertEquals(expectedValue, StreamSupport .stream( Spliterators.spliteratorUnknownSize( - response.getBody().get("groupByBoundaryResult").iterator(), Spliterator.ORDERED), + response.getBody().get("groupByResult").iterator(), Spliterator.ORDERED), false) .filter(jsonNode -> jsonNode.get("groupByObject").asText().equalsIgnoreCase("Neuenheim")) - .findFirst().get().get("ratioResult").get(0).get("ratio").asDouble(), + .findFirst().get().get("result").get(0).get("ratio").asDouble(), expectedValue * deltaPercentage); } @@ -655,7 +654,7 @@ public void elementsAreaRatioTest() { ResponseEntity response = restTemplate.postForEntity(server + port + "/elements/area/ratio", map, JsonNode.class); assertEquals(expectedValue, - response.getBody().get("ratioResult").get(0).get("ratio").asDouble(), + response.getBody().get("result").get(0).get("ratio").asDouble(), expectedValue * deltaPercentage); } @@ -671,8 +670,8 @@ public void elementsAreaRatioGroupByBoundaryTest() { map.add("filter2", "type:relation and building=*"); ResponseEntity response = restTemplate.postForEntity( server + port + "/elements/area/ratio/groupBy/boundary", map, JsonNode.class); - assertEquals(expectedValue, response.getBody().get("groupByBoundaryResult").get(1) - .get("ratioResult").get(0).get("ratio").asDouble(), expectedValue * deltaPercentage); + assertEquals(expectedValue, response.getBody().get("groupByResult").get(1) + .get("result").get(0).get("ratio").asDouble(), expectedValue * deltaPercentage); } @Test @@ -790,7 +789,7 @@ public void elementsAreaRatioSimpleFeaturePolygonTest() { ResponseEntity response = restTemplate.postForEntity(server + port + "/elements/area/ratio", map, JsonNode.class); assertEquals(expectedValue, - response.getBody().get("ratioResult").get(0).get("ratio").asDouble(), + response.getBody().get("result").get(0).get("ratio").asDouble(), expectedValue * deltaPercentage); } From e1651bdc6ae17b3372b3a5fc2f4de29e6009f046 Mon Sep 17 00:00:00 2001 From: Rosario Trischitta Date: Tue, 9 Feb 2021 17:30:42 +0100 Subject: [PATCH 3/4] style: add blank line between imports --- .../heigit/ohsome/ohsomeapi/controller/GetControllerTest.java | 1 + .../heigit/ohsome/ohsomeapi/controller/PostControllerTest.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/test/java/org/heigit/ohsome/ohsomeapi/controller/GetControllerTest.java b/src/test/java/org/heigit/ohsome/ohsomeapi/controller/GetControllerTest.java index 18d7e92d2..c93caa537 100644 --- a/src/test/java/org/heigit/ohsome/ohsomeapi/controller/GetControllerTest.java +++ b/src/test/java/org/heigit/ohsome/ohsomeapi/controller/GetControllerTest.java @@ -3,6 +3,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assume.assumeTrue; + import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.JsonNodeType; import java.io.IOException; diff --git a/src/test/java/org/heigit/ohsome/ohsomeapi/controller/PostControllerTest.java b/src/test/java/org/heigit/ohsome/ohsomeapi/controller/PostControllerTest.java index d03d3ff76..690a58e16 100644 --- a/src/test/java/org/heigit/ohsome/ohsomeapi/controller/PostControllerTest.java +++ b/src/test/java/org/heigit/ohsome/ohsomeapi/controller/PostControllerTest.java @@ -2,6 +2,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assume.assumeTrue; + import com.fasterxml.jackson.databind.JsonNode; import java.io.IOException; import java.util.Arrays; From 22058ea75dc93d29631fc09b0cf7ed246fbd4412 Mon Sep 17 00:00:00 2001 From: Rosario Trischitta Date: Wed, 10 Feb 2021 14:21:40 +0100 Subject: [PATCH 4/4] docs: update response fields --- docs/endpoints.rst | 187 ++++++++++++++++++++++----------------------- 1 file changed, 93 insertions(+), 94 deletions(-) diff --git a/docs/endpoints.rst b/docs/endpoints.rst index 3879983b1..011efa88e 100644 --- a/docs/endpoints.rst +++ b/docs/endpoints.rst @@ -277,7 +277,7 @@ How many oneway streets exist within living_street streets in Heidelberg over ti "text" : "© OpenStreetMap contributors" }, "apiVersion" : "1.3.2", - "ratioResult" : [ { + "result" : [ { "timestamp" : "2016-01-01T00:00:00Z", "value" : 28660.519999999997, "value2" : 7079.26, @@ -304,7 +304,7 @@ How many oneway streets exist within living_street streets in Heidelberg over ti "text" : "© OpenStreetMap contributors" }, "apiVersion" : "1.3.2", - "ratioResult" : [ { + "result" : [ { "timestamp" : "2016-01-01T00:00:00Z", "value" : 28660.519999999997, "value2" : 7079.26, @@ -332,7 +332,7 @@ How many oneway streets exist within living_street streets in Heidelberg over ti "text" : "© OpenStreetMap contributors" }, "apiVersion" : "1.3.2", - "ratioResult" : [ { + "result" : [ { "timestamp" : "2016-01-01T00:00:00Z", "value" : 28660.519999999997, "value2" : 7079.26, @@ -358,7 +358,7 @@ How many oneway streets exist within living_street streets in Heidelberg over ti "text" : "© OpenStreetMap contributors" }, "apiVersion" : "1.3.2", - "ratioResult" : [ { + "result" : [ { "timestamp" : "2016-01-01T00:00:00Z", "value" : 28660.519999999997, "value2" : 7079.26, @@ -438,27 +438,26 @@ How often information about the roof of buildings is present? }, "apiVersion" : "1.3.2", "groupByResult" : [ { + "groupByObject" : "remainder", "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 23225.0 - } ], - "groupByObject" : "remainder" + } ] }, { + "groupByObject" : "building:roof", "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 1418.0 - } ], - "groupByObject" : "building:roof" + } ] }, { + "groupByObject" : "building:roof:colour", "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 1178.0 - } ], - "groupByObject" : "building:roof:colour" + } ] } ] } - .. code-tab:: json curl (POST) { @@ -468,23 +467,23 @@ How often information about the roof of buildings is present? }, "apiVersion" : "1.3.2", "groupByResult" : [ { + "groupByObject" : "remainder", "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 23225.0 - } ], - "groupByObject" : "remainder" + } ] }, { + "groupByObject" : "building:roof", "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 1418.0 - } ], - "groupByObject" : "building:roof" + } ] }, { + "groupByObject" : "building:roof:colour", "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 1178.0 - } ], - "groupByObject" : "building:roof:colour" + } ] } ] } @@ -497,23 +496,23 @@ How often information about the roof of buildings is present? }, "apiVersion" : "1.3.2", "groupByResult" : [ { + "groupByObject" : "remainder", "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 23225.0 - } ], - "groupByObject" : "remainder" + } ] }, { + "groupByObject" : "building:roof", "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 1418.0 - } ], - "groupByObject" : "building:roof" + } ] }, { + "groupByObject" : "building:roof:colour", "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 1178.0 - } ], - "groupByObject" : "building:roof:colour" + } ] } ] } @@ -526,23 +525,23 @@ How often information about the roof of buildings is present? }, "apiVersion" : "1.3.2", "groupByResult" : [ { + "groupByObject" : "remainder", "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 23225.0 - } ], - "groupByObject" : "remainder" + } ] }, { + "groupByObject" : "building:roof", "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 1418.0 - } ], - "groupByObject" : "building:roof" + } ] }, { + "groupByObject" : "building:roof:colour", "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 1178.0 - } ], - "groupByObject" : "building:roof:colour" + } ] } ] } @@ -610,53 +609,53 @@ Compare length of different types of streets for two or more regions. }, "apiVersion" : "1.3.2", "groupByResult" : [ { + "groupByObject" : [ "Heidelberg", "remainder" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 1650245.08 - } ], - "groupByObject" : [ "Heidelberg", "remainder" ] + } ] }, { + "groupByObject" : [ "Heidelberg", "highway=tertiary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 48637.96 - } ], - "groupByObject" : [ "Heidelberg", "highway=tertiary" ] + } ] }, { + "groupByObject" : [ "Heidelberg", "highway=secondary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 29114.72 - } ], - "groupByObject" : [ "Heidelberg", "highway=secondary" ] + } ] }, { + "groupByObject" : [ "Heidelberg", "highway=primary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 35297.95 - } ], - "groupByObject" : [ "Heidelberg", "highway=primary" ] + } ] }, { + "groupByObject" : [ "Plankstadt", "remainder" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 56493.26 - } ], - "groupByObject" : [ "Plankstadt", "remainder" ] + } ] }, { + "groupByObject" : [ "Plankstadt", "highway=tertiary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 3399.22 - } ], - "groupByObject" : [ "Plankstadt", "highway=tertiary" ] + } ] }, { + "groupByObject" : [ "Plankstadt", "highway=secondary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 954.7 - } ], - "groupByObject" : [ "Plankstadt", "highway=secondary" ] + } ] }, { + "groupByObject" : [ "Plankstadt", "highway=primary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 0.0 - } ], - "groupByObject" : [ "Plankstadt", "highway=primary" ] + } ] } ] } @@ -670,53 +669,53 @@ Compare length of different types of streets for two or more regions. }, "apiVersion" : "1.3.2", "groupByResult" : [ { + "groupByObject" : [ "Heidelberg", "remainder" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 1650245.08 - } ], - "groupByObject" : [ "Heidelberg", "remainder" ] + } ] }, { + "groupByObject" : [ "Heidelberg", "highway=tertiary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 48637.96 - } ], - "groupByObject" : [ "Heidelberg", "highway=tertiary" ] + } ] }, { + "groupByObject" : [ "Heidelberg", "highway=secondary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 29114.72 - } ], - "groupByObject" : [ "Heidelberg", "highway=secondary" ] + } ] }, { + "groupByObject" : [ "Heidelberg", "highway=primary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 35297.95 - } ], - "groupByObject" : [ "Heidelberg", "highway=primary" ] + } ] }, { + "groupByObject" : [ "Plankstadt", "remainder" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 56493.26 - } ], - "groupByObject" : [ "Plankstadt", "remainder" ] + } ] }, { + "groupByObject" : [ "Plankstadt", "highway=tertiary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 3399.22 - } ], - "groupByObject" : [ "Plankstadt", "highway=tertiary" ] + } ] }, { + "groupByObject" : [ "Plankstadt", "highway=secondary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 954.7 - } ], - "groupByObject" : [ "Plankstadt", "highway=secondary" ] + } ] }, { + "groupByObject" : [ "Plankstadt", "highway=primary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 0.0 - } ], - "groupByObject" : [ "Plankstadt", "highway=primary" ] + } ] } ] } @@ -729,112 +728,112 @@ Compare length of different types of streets for two or more regions. }, "apiVersion" : "1.3.2", "groupByResult" : [ { + "groupByObject" : [ "Heidelberg", "remainder" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 1650245.08 - } ], - "groupByObject" : [ "Heidelberg", "remainder" ] + } ] }, { + "groupByObject" : [ "Heidelberg", "highway=tertiary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 48637.96 - } ], - "groupByObject" : [ "Heidelberg", "highway=tertiary" ] + } ] }, { + "groupByObject" : [ "Heidelberg", "highway=secondary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 29114.72 - } ], - "groupByObject" : [ "Heidelberg", "highway=secondary" ] + } ] }, { + "groupByObject" : [ "Heidelberg", "highway=primary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 35297.95 - } ], - "groupByObject" : [ "Heidelberg", "highway=primary" ] + } ] }, { + "groupByObject" : [ "Plankstadt", "remainder" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 56493.26 - } ], - "groupByObject" : [ "Plankstadt", "remainder" ] + } ] }, { + "groupByObject" : [ "Plankstadt", "highway=tertiary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 3399.22 - } ], - "groupByObject" : [ "Plankstadt", "highway=tertiary" ] + } ] }, { + "groupByObject" : [ "Plankstadt", "highway=secondary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 954.7 - } ], - "groupByObject" : [ "Plankstadt", "highway=secondary" ] + } ] }, { + "groupByObject" : [ "Plankstadt", "highway=primary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 0.0 - } ], - "groupByObject" : [ "Plankstadt", "highway=primary" ] + } ] } ] } .. code-tab:: json R - { + { "attribution" : { "url" : "https://ohsome.org/copyrights", "text" : "© OpenStreetMap contributors" }, "apiVersion" : "1.3.2", "groupByResult" : [ { + "groupByObject" : [ "Heidelberg", "remainder" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 1650245.08 - } ], - "groupByObject" : [ "Heidelberg", "remainder" ] + } ] }, { + "groupByObject" : [ "Heidelberg", "highway=tertiary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 48637.96 - } ], - "groupByObject" : [ "Heidelberg", "highway=tertiary" ] + } ] }, { + "groupByObject" : [ "Heidelberg", "highway=secondary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 29114.72 - } ], - "groupByObject" : [ "Heidelberg", "highway=secondary" ] + } ] }, { + "groupByObject" : [ "Heidelberg", "highway=primary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 35297.95 - } ], - "groupByObject" : [ "Heidelberg", "highway=primary" ] + } ] }, { + "groupByObject" : [ "Plankstadt", "remainder" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 56493.26 - } ], - "groupByObject" : [ "Plankstadt", "remainder" ] + } ] }, { + "groupByObject" : [ "Plankstadt", "highway=tertiary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 3399.22 - } ], - "groupByObject" : [ "Plankstadt", "highway=tertiary" ] + } ] }, { + "groupByObject" : [ "Plankstadt", "highway=secondary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 954.7 - } ], - "groupByObject" : [ "Plankstadt", "highway=secondary" ] + } ] }, { + "groupByObject" : [ "Plankstadt", "highway=primary" ], "result" : [ { "timestamp" : "2018-01-01T00:00:00Z", "value" : 0.0 - } ], - "groupByObject" : [ "Plankstadt", "highway=primary" ] + } ] } ] }