From 27da2a9c9ef24228d669f018825918ee35841180 Mon Sep 17 00:00:00 2001 From: Patrick Brosi Date: Tue, 23 Jul 2019 21:32:07 +0200 Subject: [PATCH] output -T geojson as WGS84 coordinates --- src/pfaedle/PfaedleMain.cpp | 6 +++++- src/pfaedle/eval/Collector.cpp | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pfaedle/PfaedleMain.cpp b/src/pfaedle/PfaedleMain.cpp index 4c6e309..974cead 100644 --- a/src/pfaedle/PfaedleMain.cpp +++ b/src/pfaedle/PfaedleMain.cpp @@ -269,7 +269,11 @@ int main(int argc, char** argv) { auto l = shapeBuilder.shapeL(singleTrip); - o.print(l, util::json::Dict{{"ver", "new"}}); + // reproject to WGS84 to match RFC 7946 + for (auto& p : l) { + p = util::geo::webMercToLatLng(p.getX(), p.getY()); + } + o.flush(); pstr.close(); diff --git a/src/pfaedle/eval/Collector.cpp b/src/pfaedle/eval/Collector.cpp index 07c1ae8..eba44c5 100644 --- a/src/pfaedle/eval/Collector.cpp +++ b/src/pfaedle/eval/Collector.cpp @@ -110,6 +110,7 @@ double Collector::add(const Trip* t, const Shape* oldS, const Shape& newS, gjout.print(oldL, util::json::Dict{{"ver", "old"}}); oldLCut.insert(oldLCut.end(), oldL.begin(), oldL.end()); } + for (auto newL : newSegs) { gjout.print(newL, util::json::Dict{{"ver", "new"}}); newLCut.insert(newLCut.end(), newL.begin(), newL.end());