diff options
author | Anatoly Serdtcev <serdtcev@maps.me> | 2019-06-11 12:54:09 +0300 |
---|---|---|
committer | Anatoly Serdtcev <serdtcev@maps.me> | 2019-06-11 14:13:48 +0300 |
commit | e8a52e1acba3a08907cfec96011b48336fcdef68 (patch) | |
tree | 984b7e38b9393630d7357a2037118413378db1fc /generator | |
parent | d5914cbce6a5abfa9795e3780f38a8c8e1ccef92 (diff) |
[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 a32381d3c2..19a3748ea1 100644 --- a/generator/streets/streets_builder.cpp +++ b/generator/streets/streets_builder.cpp @@ -168,11 +168,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 065b13f796..944018aaa1 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); |