diff options
author | Sergey Yershov <syershov@maps.me> | 2019-06-13 12:51:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-13 12:51:03 +0300 |
commit | 679549a9ddbf1088ff555522f63619378fe2e41d (patch) | |
tree | 0fe703f0e18c0481978f5d88414645a64b85a4ef /generator | |
parent | aad0fd0de0014b7adfdc6166b107721c232ca1ea (diff) | |
parent | e8a52e1acba3a08907cfec96011b48336fcdef68 (diff) |
Merge pull request #11025 from cc-engineering/generator.geojson-lon-lat
[generator] Fix jsonl generation: GeoJSON lat-lon format
Diffstat (limited to 'generator')
-rw-r--r-- | generator/geo_objects/geo_objects.cpp | 4 | ||||
-rw-r--r-- | generator/regions/to_string_policy.cpp | 2 | ||||
-rw-r--r-- | generator/streets/streets_builder.cpp | 4 | ||||
-rw-r--r-- | generator/streets/streets_builder.hpp | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/generator/geo_objects/geo_objects.cpp b/generator/geo_objects/geo_objects.cpp index 6b4234dbcd..fc1ebf9278 100644 --- a/generator/geo_objects/geo_objects.cpp +++ b/generator/geo_objects/geo_objects.cpp @@ -57,8 +57,8 @@ void UpdateCoordinates(m2::PointD const & point, base::JSONPtr & json) if (json_array_size(coordinates) == 2) { auto const latLon = MercatorBounds::ToLatLon(point); - json_array_set_new(coordinates, 0, ToJSON(latLon.m_lat).release()); - json_array_set_new(coordinates, 1, ToJSON(latLon.m_lon).release()); + json_array_set_new(coordinates, 0, ToJSON(latLon.m_lon).release()); + json_array_set_new(coordinates, 1, ToJSON(latLon.m_lat).release()); } } diff --git a/generator/regions/to_string_policy.cpp b/generator/regions/to_string_policy.cpp index c903dfb465..1524721535 100644 --- a/generator/regions/to_string_policy.cpp +++ b/generator/regions/to_string_policy.cpp @@ -21,8 +21,8 @@ std::string JsonPolicy::ToString(NodePath const & path) const auto coordinates = base::NewJSONArray(); auto const tmpCenter = main.GetCenter(); auto const center = MercatorBounds::ToLatLon({tmpCenter.get<0>(), tmpCenter.get<1>()}); - ToJSONArray(*coordinates, center.m_lat); ToJSONArray(*coordinates, center.m_lon); + ToJSONArray(*coordinates, center.m_lat); ToJSONObject(*geometry, "coordinates", coordinates); auto localeEn = base::NewJSONObject(); diff --git a/generator/streets/streets_builder.cpp b/generator/streets/streets_builder.cpp index af1058320c..ceee7a07f7 100644 --- a/generator/streets/streets_builder.cpp +++ b/generator/streets/streets_builder.cpp @@ -172,11 +172,11 @@ std::unique_ptr<char, JSONFreeDeleter> StreetsBuilder::MakeStreetValue( auto const & leftBottom = MercatorBounds::ToLatLon(bbox.LeftBottom()); auto const & rightTop = MercatorBounds::ToLatLon(bbox.RightTop()); auto const & bboxArray = std::vector<double>{ - leftBottom.m_lat, leftBottom.m_lon, rightTop.m_lat, rightTop.m_lon}; + leftBottom.m_lon, leftBottom.m_lat, rightTop.m_lon, rightTop.m_lat}; ToJSONObject(*streetObject, "bbox", std::move(bboxArray)); auto const & pinLatLon = MercatorBounds::ToLatLon(pinPoint); - auto const & pinArray = std::vector<double>{pinLatLon.m_lat, pinLatLon.m_lon}; + auto const & pinArray = std::vector<double>{pinLatLon.m_lon, pinLatLon.m_lat}; ToJSONObject(*streetObject, "pin", std::move(pinArray)); auto const value = json_dumps(streetObject.get(), JSON_COMPACT); diff --git a/generator/streets/streets_builder.hpp b/generator/streets/streets_builder.hpp index f9b6b1c1e8..26429f33ae 100644 --- a/generator/streets/streets_builder.hpp +++ b/generator/streets/streets_builder.hpp @@ -32,8 +32,8 @@ public: void AssembleStreets(std::string const & pathInStreetsTmpMwm); void AssembleBindings(std::string const & pathInGeoObjectsTmpMwm); // Save built streets in the jsonl format with the members: "properties", "bbox" (array: left bottom - // latitude, left bottom longitude, right top latitude, right top longitude), "pin" (array: latitude, - // longitude). + // longitude, left bottom latitude, right top longitude, right top latitude), "pin" (array: longitude, + // latitude). void SaveStreetsKv(std::ostream & streamStreetsKv); static bool IsStreet(OsmElement const & element); |