From a0680318fbd12e3cd6c226079e69bafcefd052be Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Thu, 23 Nov 2023 16:13:43 +0100 Subject: [PATCH] fix timestamp format in ratio/groupBy/boundary endpoint, closes #318 --- CHANGELOG.md | 6 ++++++ .../ohsome/ohsomeapi/executor/ElementsRequestExecutor.java | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a848e67b..3158b580 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ Changelog ## 1.11.0-SNAPSHOT (current master) +### Bug Fixes +* Fix inconsistent timestamp format in `/elements/(aggregation)/ratio/groupBy/boundary` request responses ([#318]) + +[#318]: https://github.com/GIScience/ohsome-api/issues/318 + + ## 1.10.1 * Fix performance degradation in previous release (version 1.10.0) which made data extractions very slow for medium to large query areas ([oshdb#516]) 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 ea5de536..3a34dd75 100644 --- a/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/ElementsRequestExecutor.java +++ b/src/main/lombok/org/heigit/ohsome/ohsomeapi/executor/ElementsRequestExecutor.java @@ -925,7 +925,8 @@ public static

Response aggregateBasicFiltersRat if (!timeArrayFilled) { String time = innerEntry.getKey().getFirstIndex().toString(); if (matchesBothCount == 0 || !timeArray[timeArrayCount - 1].equals(time)) { - timeArray[timeArrayCount] = innerEntry.getKey().getFirstIndex().toString(); + timeArray[timeArrayCount] = TimestampFormatter.getInstance().isoDateTime( + innerEntry.getKey().getFirstIndex()); timeArrayCount++; } } @@ -1085,7 +1086,8 @@ public static

Response aggregateRatioGroupByBou if (!timeArrayFilled) { String time = innerEntry.getKey().getFirstIndex().toString(); if (matchesBothCount == 0 || !timeArray[timeArrayCount - 1].equals(time)) { - timeArray[timeArrayCount] = innerEntry.getKey().getFirstIndex().toString(); + timeArray[timeArrayCount] = TimestampFormatter.getInstance().isoDateTime( + innerEntry.getKey().getFirstIndex()); timeArrayCount++; } }