output -T geojson as WGS84 coordinates

This commit is contained in:
Patrick Brosi 2019-07-23 21:32:07 +02:00
parent bfca604ab5
commit 27da2a9c9e
2 changed files with 6 additions and 1 deletions

View file

@ -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<double>(p.getX(), p.getY());
}
o.flush();
pstr.close();

View file

@ -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());