Skip to content

Commit

Permalink
[geometry] LatLon refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
bykoianko authored and mpimenov committed May 30, 2019
1 parent c0fb90a commit b0868d6
Show file tree
Hide file tree
Showing 76 changed files with 206 additions and 204 deletions.
2 changes: 1 addition & 1 deletion android/jni/com/mapswithme/maps/Framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ Java_com_mapswithme_maps_Framework_nativeGetRouteFollowingInfo(JNIEnv * env, jcl
jni::ToJavaString(env, info.m_targetUnitsSuffix), jni::ToJavaString(env, info.m_distToTurn),
jni::ToJavaString(env, info.m_turnUnitsSuffix), jni::ToJavaString(env, info.m_sourceName),
jni::ToJavaString(env, info.m_displayedStreetName), info.m_completionPercent, info.m_turn, info.m_nextTurn, info.m_pedestrianTurn,
info.m_pedestrianDirectionPos.lat, info.m_pedestrianDirectionPos.lon, info.m_exitNum, info.m_time, jLanes,
info.m_pedestrianDirectionPos.m_lat, info.m_pedestrianDirectionPos.m_lon, info.m_exitNum, info.m_time, jLanes,
static_cast<jboolean>(isSpeedLimitExceeded), static_cast<jboolean>(shouldPlaySignal));
ASSERT(result, (jni::DescribeException()));
return result;
Expand Down
4 changes: 2 additions & 2 deletions android/jni/com/mapswithme/maps/SearchEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ jobject ToJavaResult(Result & result, search::ProductInfo const & productInfo, b
{
jni::TScopedLocalRef name(env, jni::ToJavaString(env, result.GetString()));
jni::TScopedLocalRef suggest(env, jni::ToJavaString(env, result.GetSuggestionString()));
jobject ret = env->NewObject(g_resultClass, g_suggestConstructor, name.get(), suggest.get(), ll.lat, ll.lon, ranges.get());
jobject ret = env->NewObject(g_resultClass, g_suggestConstructor, name.get(), suggest.get(), ll.m_lat, ll.m_lon, ranges.get());
ASSERT(ret, ());
return ret;
}
Expand Down Expand Up @@ -365,7 +365,7 @@ jobject ToJavaResult(Result & result, search::ProductInfo const & productInfo, b
g_popularityConstructor,
static_cast<jint>(result.GetRankingInfo().m_popularity)));
jobject ret =
env->NewObject(g_resultClass, g_resultConstructor, name.get(), desc.get(), ll.lat, ll.lon,
env->NewObject(g_resultClass, g_resultConstructor, name.get(), desc.get(), ll.m_lat, ll.m_lon,
ranges.get(), result.IsHotel(), productInfo.m_isLocalAdsCustomer,
popularity.get());
ASSERT(ret, ());
Expand Down
6 changes: 3 additions & 3 deletions android/jni/com/mapswithme/maps/UserMarkHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ jobject CreateMapObject(JNIEnv * env, place_page::Info const & info)
{
return CreateMapObject(env, info.GetID().GetMwmName(), info.GetID().GetMwmVersion(),
info.GetID().m_index, kMyPosition, info.GetTitle(),
info.GetSecondaryTitle(), info.GetSubtitle(), ll.lat, ll.lon,
info.GetSecondaryTitle(), info.GetSubtitle(), ll.m_lat, ll.m_lon,
info.GetAddress(), {}, "", jbanners.get(), jTaxiTypes.get(),
info.GetBookingSearchUrl(), localAdInfo.get(), routingPointInfo.get(),
info.GetOpeningMode(), info.ShouldShowUGC(), info.CanBeRated(),
Expand All @@ -219,7 +219,7 @@ jobject CreateMapObject(JNIEnv * env, place_page::Info const & info)
{
return CreateMapObject(
env, info.GetID().GetMwmName(), info.GetID().GetMwmVersion(), info.GetID().m_index,
kApiPoint, info.GetTitle(), info.GetSecondaryTitle(), info.GetSubtitle(), ll.lat, ll.lon,
kApiPoint, info.GetTitle(), info.GetSecondaryTitle(), info.GetSubtitle(), ll.m_lat, ll.m_lon,
info.GetAddress(), info.GetMetadata(), info.GetApiUrl(), jbanners.get(), jTaxiTypes.get(),
info.GetBookingSearchUrl(), localAdInfo.get(), routingPointInfo.get(), info.GetOpeningMode(),
info.ShouldShowUGC(), info.CanBeRated(), info.CanBeReviewed(), jratings.get(),
Expand All @@ -228,7 +228,7 @@ jobject CreateMapObject(JNIEnv * env, place_page::Info const & info)

return CreateMapObject(
env, info.GetID().GetMwmName(), info.GetID().GetMwmVersion(), info.GetID().m_index, kPoi,
info.GetTitle(), info.GetSecondaryTitle(), info.GetSubtitle(), ll.lat, ll.lon,
info.GetTitle(), info.GetSecondaryTitle(), info.GetSubtitle(), ll.m_lat, ll.m_lon,
info.GetAddress(), info.IsFeature() ? info.GetMetadata() : Metadata(), "", jbanners.get(),
jTaxiTypes.get(), info.GetBookingSearchUrl(), localAdInfo.get(), routingPointInfo.get(),
info.GetOpeningMode(), info.ShouldShowUGC(), info.CanBeRated(), info.CanBeReviewed(),
Expand Down
12 changes: 6 additions & 6 deletions coding/coding_tests/traffic_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ double CalculateLength(vector<TrafficGPSEncoder::DataPoint> const & path)
double res = 0;
for (size_t i = 1; i < path.size(); ++i)
{
auto p1 = MercatorBounds::FromLatLon(path[i - 1].m_latLon.lat, path[i - 1].m_latLon.lon);
auto p2 = MercatorBounds::FromLatLon(path[i].m_latLon.lat, path[i].m_latLon.lon);
auto p1 = MercatorBounds::FromLatLon(path[i - 1].m_latLon.m_lat, path[i - 1].m_latLon.m_lon);
auto p2 = MercatorBounds::FromLatLon(path[i].m_latLon.m_lat, path[i].m_latLon.m_lon);
res += MercatorBounds::DistanceOnEarth(p1, p2);
}
return res;
Expand All @@ -48,10 +48,10 @@ void Test(vector<TrafficGPSEncoder::DataPoint> & points)
{
TEST_EQUAL(points[i].m_timestamp, result[i].m_timestamp,
(points[i].m_timestamp, result[i].m_timestamp));
TEST(base::AlmostEqualAbsOrRel(points[i].m_latLon.lat, result[i].m_latLon.lat, kEps),
(points[i].m_latLon.lat, result[i].m_latLon.lat));
TEST(base::AlmostEqualAbsOrRel(points[i].m_latLon.lon, result[i].m_latLon.lon, kEps),
(points[i].m_latLon.lon, result[i].m_latLon.lon));
TEST(base::AlmostEqualAbsOrRel(points[i].m_latLon.m_lat, result[i].m_latLon.m_lat, kEps),
(points[i].m_latLon.m_lat, result[i].m_latLon.m_lat));
TEST(base::AlmostEqualAbsOrRel(points[i].m_latLon.m_lon, result[i].m_latLon.m_lon, kEps),
(points[i].m_latLon.m_lon, result[i].m_latLon.m_lon));
}

if (version == TrafficGPSEncoder::kLatestVersion)
Expand Down
8 changes: 4 additions & 4 deletions coding/serdes_json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ class SerializerJson
void operator()(ms::LatLon const & ll, char const * name = nullptr)
{
NewScopeWith(base::NewJSONObject(), name, [this, &ll] {
(*this)(ll.lat, "lat");
(*this)(ll.lon, "lon");
(*this)(ll.m_lat, "lat");
(*this)(ll.m_lon, "lon");
});
}

Expand Down Expand Up @@ -374,8 +374,8 @@ class DeserializerJson
void operator()(ms::LatLon & ll, char const * name = nullptr)
{
json_t * outerContext = SaveContext(name);
(*this)(ll.lat, "lat");
(*this)(ll.lon, "lon");
(*this)(ll.m_lat, "lat");
(*this)(ll.m_lon, "lon");
RestoreContext(outerContext);
}

Expand Down
16 changes: 8 additions & 8 deletions coding/traffic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ class TrafficGPSEncoder
if (!points.empty())
{
uint64_t const firstTimestamp = points[0].m_timestamp;
uint32_t const firstLat = DoubleToUint32(points[0].m_latLon.lat, ms::LatLon::kMinLat,
uint32_t const firstLat = DoubleToUint32(points[0].m_latLon.m_lat, ms::LatLon::kMinLat,
ms::LatLon::kMaxLat, kCoordBits);
uint32_t const firstLon = DoubleToUint32(points[0].m_latLon.lon, ms::LatLon::kMinLon,
uint32_t const firstLon = DoubleToUint32(points[0].m_latLon.m_lon, ms::LatLon::kMinLon,
ms::LatLon::kMaxLon, kCoordBits);
WriteVarUint(writer, firstTimestamp);
WriteVarUint(writer, firstLat);
Expand All @@ -102,9 +102,9 @@ class TrafficGPSEncoder
ASSERT_LESS_OR_EQUAL(points[i - 1].m_timestamp, points[i].m_timestamp, ());

uint64_t const deltaTimestamp = points[i].m_timestamp - points[i - 1].m_timestamp;
uint32_t deltaLat = DoubleToUint32(points[i].m_latLon.lat - points[i - 1].m_latLon.lat,
uint32_t deltaLat = DoubleToUint32(points[i].m_latLon.m_lat - points[i - 1].m_latLon.m_lat,
kMinDeltaLat, kMaxDeltaLat, kCoordBits);
uint32_t deltaLon = DoubleToUint32(points[i].m_latLon.lon - points[i - 1].m_latLon.lon,
uint32_t deltaLon = DoubleToUint32(points[i].m_latLon.m_lon - points[i - 1].m_latLon.m_lon,
kMinDeltaLon, kMaxDeltaLon, kCoordBits);

WriteVarUint(writer, deltaTimestamp);
Expand All @@ -125,9 +125,9 @@ class TrafficGPSEncoder
if (!points.empty())
{
uint64_t const firstTimestamp = points[0].m_timestamp;
uint32_t const firstLat = DoubleToUint32(points[0].m_latLon.lat, ms::LatLon::kMinLat,
uint32_t const firstLat = DoubleToUint32(points[0].m_latLon.m_lat, ms::LatLon::kMinLat,
ms::LatLon::kMaxLat, kCoordBits);
uint32_t const firstLon = DoubleToUint32(points[0].m_latLon.lon, ms::LatLon::kMinLon,
uint32_t const firstLon = DoubleToUint32(points[0].m_latLon.m_lon, ms::LatLon::kMinLon,
ms::LatLon::kMaxLon, kCoordBits);
uint32_t const traffic = points[0].m_traffic;
WriteVarUint(writer, firstTimestamp);
Expand All @@ -141,9 +141,9 @@ class TrafficGPSEncoder
ASSERT_LESS_OR_EQUAL(points[i - 1].m_timestamp, points[i].m_timestamp, ());

uint64_t const deltaTimestamp = points[i].m_timestamp - points[i - 1].m_timestamp;
uint32_t deltaLat = DoubleToUint32(points[i].m_latLon.lat - points[i - 1].m_latLon.lat,
uint32_t deltaLat = DoubleToUint32(points[i].m_latLon.m_lat - points[i - 1].m_latLon.m_lat,
kMinDeltaLat, kMaxDeltaLat, kCoordBits);
uint32_t deltaLon = DoubleToUint32(points[i].m_latLon.lon - points[i - 1].m_latLon.lon,
uint32_t deltaLon = DoubleToUint32(points[i].m_latLon.m_lon - points[i - 1].m_latLon.m_lon,
kMinDeltaLon, kMaxDeltaLon, kCoordBits);

uint32_t const traffic = points[i - 1].m_traffic;
Expand Down
6 changes: 3 additions & 3 deletions editor/changeset_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ m2::RectD GetBoundingRect(vector<m2::PointD> const & geometry)
for (auto const & p : geometry)
{
auto const latLon = MercatorBounds::ToLatLon(p);
rect.Add({latLon.lon, latLon.lat});
rect.Add({latLon.m_lon, latLon.m_lat});
}
return rect;
}
Expand Down Expand Up @@ -132,7 +132,7 @@ ChangesetWrapper::~ChangesetWrapper()
void ChangesetWrapper::LoadXmlFromOSM(ms::LatLon const & ll, pugi::xml_document & doc,
double radiusInMeters)
{
auto const response = m_api.GetXmlFeaturesAtLatLon(ll.lat, ll.lon, radiusInMeters);
auto const response = m_api.GetXmlFeaturesAtLatLon(ll.m_lat, ll.m_lon, radiusInMeters);
if (response.first != OsmOAuth::HTTP::OK)
MYTHROW(HttpErrorException, ("HTTP error", response, "with GetXmlFeaturesAtLatLon", ll));

Expand All @@ -145,7 +145,7 @@ void ChangesetWrapper::LoadXmlFromOSM(ms::LatLon const & ll, pugi::xml_document
void ChangesetWrapper::LoadXmlFromOSM(ms::LatLon const & min, ms::LatLon const & max,
pugi::xml_document & doc)
{
auto const response = m_api.GetXmlFeaturesInRect(min.lat, min.lon, max.lat, max.lon);
auto const response = m_api.GetXmlFeaturesInRect(min.m_lat, min.m_lon, max.m_lat, max.m_lon);
if (response.first != OsmOAuth::HTTP::OK)
MYTHROW(HttpErrorException, ("HTTP error", response, "with GetXmlFeaturesInRect", min, max));

Expand Down
10 changes: 5 additions & 5 deletions editor/editor_notes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ bool LoadFromXml(pugi::xml_document const & xml, std::list<editor::Note> & notes

auto const node = xNode.node();
auto const lat = node.attribute("lat");
if (!lat || !strings::to_double(lat.value(), latLon.lat))
if (!lat || !strings::to_double(lat.value(), latLon.m_lat))
continue;

auto const lon = node.attribute("lon");
if (!lon || !strings::to_double(lon.value(), latLon.lon))
if (!lon || !strings::to_double(lon.value(), latLon.m_lon))
continue;

auto const text = node.attribute("text");
Expand All @@ -66,9 +66,9 @@ void SaveToXml(std::list<editor::Note> const & notes, pugi::xml_document & xml,
auto node = root.append_child("note");

node.append_attribute("lat") =
strings::to_string_dac(note.m_point.lat, kDigitsAfterComma).data();
strings::to_string_dac(note.m_point.m_lat, kDigitsAfterComma).data();
node.append_attribute("lon") =
strings::to_string_dac(note.m_point.lon, kDigitsAfterComma).data();
strings::to_string_dac(note.m_point.m_lon, kDigitsAfterComma).data();
node.append_attribute("text") = note.m_note.data();
}
}
Expand Down Expand Up @@ -144,7 +144,7 @@ void Notes::CreateNote(ms::LatLon const & latLon, std::string const & text)
return;
}

if (!MercatorBounds::ValidLat(latLon.lat) || !MercatorBounds::ValidLon(latLon.lon))
if (!MercatorBounds::ValidLat(latLon.m_lat) || !MercatorBounds::ValidLon(latLon.m_lon))
{
LOG(LWARNING, ("A note attached to a wrong latLon", latLon));
return;
Expand Down
2 changes: 1 addition & 1 deletion editor/osm_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ void Editor::UploadChanges(string const & key, string const & secret, ChangesetT
{"our", ourDebugFeatureString},
{"mwm", fti.m_object.GetID().GetMwmName()},
{"mwm_version", strings::to_string(fti.m_object.GetID().GetMwmVersion())}},
alohalytics::Location::FromLatLon(ll.lat, ll.lon));
alohalytics::Location::FromLatLon(ll.m_lat, ll.m_lon));
}

GetPlatform().RunTask(Platform::Thread::Gui,
Expand Down
6 changes: 3 additions & 3 deletions editor/server_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ void ServerApi06::CloseChangeSet(uint64_t changesetId) const
uint64_t ServerApi06::CreateNote(ms::LatLon const & ll, std::string const & message) const
{
CHECK(!message.empty(), ("Note content should not be empty."));
std::string const params = "?lat=" + strings::to_string_dac(ll.lat, 7) +
"&lon=" + strings::to_string_dac(ll.lon, 7) +
std::string const params = "?lat=" + strings::to_string_dac(ll.m_lat, 7) +
"&lon=" + strings::to_string_dac(ll.m_lon, 7) +
"&text=" + UrlEncode(message + " #mapsme");
OsmOAuth::Response const response = m_auth.Request("/notes" + params, "POST");
if (response.first != OsmOAuth::HTTP::OK)
Expand Down Expand Up @@ -200,7 +200,7 @@ OsmOAuth::Response ServerApi06::GetXmlFeaturesAtLatLon(double lat, double lon, d

OsmOAuth::Response ServerApi06::GetXmlFeaturesAtLatLon(ms::LatLon const & ll, double radiusInMeters) const
{
return GetXmlFeaturesAtLatLon(ll.lat, ll.lon, radiusInMeters);
return GetXmlFeaturesAtLatLon(ll.m_lat, ll.m_lon, radiusInMeters);
}

} // namespace osm
8 changes: 4 additions & 4 deletions editor/xml_feature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ pugi::xml_node FindTag(pugi::xml_document const & document, string const & key)
ms::LatLon GetLatLonFromNode(pugi::xml_node const & node)
{
ms::LatLon ll;
if (!strings::to_double(node.attribute("lat").value(), ll.lat))
if (!strings::to_double(node.attribute("lat").value(), ll.m_lat))
{
MYTHROW(editor::NoLatLon,
("Can't parse lat attribute:", string(node.attribute("lat").value())));
}
if (!strings::to_double(node.attribute("lon").value(), ll.lon))
if (!strings::to_double(node.attribute("lon").value(), ll.m_lon))
{
MYTHROW(editor::NoLatLon,
("Can't parse lon attribute:", string(node.attribute("lon").value())));
Expand Down Expand Up @@ -203,8 +203,8 @@ ms::LatLon XMLFeature::GetCenter() const
void XMLFeature::SetCenter(ms::LatLon const & ll)
{
ASSERT_EQUAL(GetType(), Type::Node, ());
SetAttribute("lat", strings::to_string_dac(ll.lat, kLatLonTolerance));
SetAttribute("lon", strings::to_string_dac(ll.lon, kLatLonTolerance));
SetAttribute("lat", strings::to_string_dac(ll.m_lat, kLatLonTolerance));
SetAttribute("lon", strings::to_string_dac(ll.m_lon, kLatLonTolerance));
}

void XMLFeature::SetCenter(m2::PointD const & mercatorCenter)
Expand Down
8 changes: 4 additions & 4 deletions feature_list/feature_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ bool HasAtm(FeatureType & f)
string BuildUniqueId(ms::LatLon const & coords, string const & name)
{
ostringstream ss;
ss << strings::to_string_with_digits_after_comma(coords.lat, 6) << ','
<< strings::to_string_with_digits_after_comma(coords.lon, 6) << ',' << name;
ss << strings::to_string_with_digits_after_comma(coords.m_lat, 6) << ','
<< strings::to_string_with_digits_after_comma(coords.m_lon, 6) << ',' << name;
uint32_t hash = 0;
for (char const c : ss.str())
hash = hash * 101 + c;
Expand Down Expand Up @@ -238,8 +238,8 @@ class Processor
osmId = f.GetMetadata().Get(feature::Metadata::FMD_SPONSORED_ID) + "00";
}
string const & uid = BuildUniqueId(ll, name);
string const & lat = strings::to_string_with_digits_after_comma(ll.lat, 6);
string const & lon = strings::to_string_with_digits_after_comma(ll.lon, 6);
string const & lat = strings::to_string_with_digits_after_comma(ll.m_lat, 6);
string const & lon = strings::to_string_with_digits_after_comma(ll.m_lon, 6);
search::ReverseGeocoder::Address addr;
string addrStreet = "";
string addrHouse = "";
Expand Down
6 changes: 3 additions & 3 deletions generator/booking_dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ BookingHotel::BookingHotel(std::string const & src)

CLOG(LDEBUG, strings::to_uint(rec[FieldIndex(Fields::Id)], m_id.Get()), ());
// TODO(mgsergio): Use ms::LatLon.
CLOG(LDEBUG, strings::to_double(rec[FieldIndex(Fields::Latitude)], m_latLon.lat), ());
CLOG(LDEBUG, strings::to_double(rec[FieldIndex(Fields::Longtitude)], m_latLon.lon), ());
CLOG(LDEBUG, strings::to_double(rec[FieldIndex(Fields::Latitude)], m_latLon.m_lat), ());
CLOG(LDEBUG, strings::to_double(rec[FieldIndex(Fields::Longtitude)], m_latLon.m_lon), ());

m_name = rec[FieldIndex(Fields::Name)];
m_address = rec[FieldIndex(Fields::Address)];
Expand Down Expand Up @@ -87,7 +87,7 @@ void BookingDataset::BuildObject(Object const & hotel,
{
FeatureBuilder1 fb;

fb.SetCenter(MercatorBounds::FromLatLon(hotel.m_latLon.lat, hotel.m_latLon.lon));
fb.SetCenter(MercatorBounds::FromLatLon(hotel.m_latLon.m_lat, hotel.m_latLon.m_lon));

auto & metadata = fb.GetMetadata();
metadata.Set(feature::Metadata::FMD_SPONSORED_ID, strings::to_string(hotel.m_id.Get()));
Expand Down
10 changes: 5 additions & 5 deletions generator/booking_quality_check/booking_quality_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ string PrintBuilder(FeatureBuilder1 const & fb)
s << "Address: " << address << '\t';

auto const center = MercatorBounds::ToLatLon(fb.GetKeyPoint());
s << "lat: " << center.lat << " lon: " << center.lon << '\t';
s << "lat: " << center.m_lat << " lon: " << center.m_lon << '\t';

if (fb.GetGeomType() == feature::GeomType::Point)
s << "GeomType: Point";
Expand Down Expand Up @@ -229,8 +229,8 @@ void GenerateFactors(Dataset const & dataset,
ost << "# " << PrintBuilder(feature) << endl;
ost << "# " << object << endl;
ost << "# URL: https://www.openstreetmap.org/?mlat="
<< object.m_latLon.lat << "&mlon=" << object.m_latLon.lon << "#map=18/"
<< object.m_latLon.lat << "/" << object.m_latLon.lon << endl;
<< object.m_latLon.m_lat << "&mlon=" << object.m_latLon.m_lon << "#map=18/"
<< object.m_latLon.m_lat << "/" << object.m_latLon.m_lon << endl;
}
}

Expand Down Expand Up @@ -281,8 +281,8 @@ void GenerateSample(Dataset const & dataset,
outStream << "# " << PrintBuilder(fb) << endl;
outStream << "# " << object << endl;
outStream << "# URL: https://www.openstreetmap.org/?mlat="
<< object.m_latLon.lat << "&mlon=" << object.m_latLon.lon
<< "#map=18/" << object.m_latLon.lat << "/" << object.m_latLon.lon << endl;
<< object.m_latLon.m_lat << "&mlon=" << object.m_latLon.m_lon
<< "#map=18/" << object.m_latLon.m_lat << "/" << object.m_latLon.m_lon << endl;
}
if (!sponsoredIndexes.empty())
outStream << endl << endl;
Expand Down
2 changes: 1 addition & 1 deletion generator/borders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ void UnpackBorders(string const & baseDir, string const & targetDir)
for (auto p : points)
{
ms::LatLon const ll = MercatorBounds::ToLatLon(p);
poly << " " << scientific << ll.lon << " " << ll.lat << endl;
poly << " " << scientific << ll.m_lon << " " << ll.m_lat << endl;
}
poly << "END" << endl;
}
Expand Down
4 changes: 2 additions & 2 deletions generator/extract_addr/extract_addr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ void PrintFeature(FeatureBuilder1 const & fb, uint64_t)

auto const center = MercatorBounds::ToLatLon(fb.GetKeyPoint());
auto coordinates = base::NewJSONArray();
ToJSONArray(*coordinates, std::round(center.lon * kRoundDigits) / kRoundDigits);
ToJSONArray(*coordinates, std::round(center.lat * kRoundDigits) / kRoundDigits);
ToJSONArray(*coordinates, std::round(center.m_lon * kRoundDigits) / kRoundDigits);
ToJSONArray(*coordinates, std::round(center.m_lat * kRoundDigits) / kRoundDigits);
auto geometry = base::NewJSONObject();
ToJSONObject(*geometry, "type", "Point");
ToJSONObject(*geometry, "coordinates", coordinates);
Expand Down
Loading

0 comments on commit b0868d6

Please sign in to comment.