Skip to content

Commit b0868d6

Browse files
bykoiankompimenov
authored andcommitted
[geometry] LatLon refactoring.
1 parent c0fb90a commit b0868d6

File tree

76 files changed

+206
-204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+206
-204
lines changed

android/jni/com/mapswithme/maps/Framework.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ Java_com_mapswithme_maps_Framework_nativeGetRouteFollowingInfo(JNIEnv * env, jcl
13171317
jni::ToJavaString(env, info.m_targetUnitsSuffix), jni::ToJavaString(env, info.m_distToTurn),
13181318
jni::ToJavaString(env, info.m_turnUnitsSuffix), jni::ToJavaString(env, info.m_sourceName),
13191319
jni::ToJavaString(env, info.m_displayedStreetName), info.m_completionPercent, info.m_turn, info.m_nextTurn, info.m_pedestrianTurn,
1320-
info.m_pedestrianDirectionPos.lat, info.m_pedestrianDirectionPos.lon, info.m_exitNum, info.m_time, jLanes,
1320+
info.m_pedestrianDirectionPos.m_lat, info.m_pedestrianDirectionPos.m_lon, info.m_exitNum, info.m_time, jLanes,
13211321
static_cast<jboolean>(isSpeedLimitExceeded), static_cast<jboolean>(shouldPlaySignal));
13221322
ASSERT(result, (jni::DescribeException()));
13231323
return result;

android/jni/com/mapswithme/maps/SearchEngine.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ jobject ToJavaResult(Result & result, search::ProductInfo const & productInfo, b
327327
{
328328
jni::TScopedLocalRef name(env, jni::ToJavaString(env, result.GetString()));
329329
jni::TScopedLocalRef suggest(env, jni::ToJavaString(env, result.GetSuggestionString()));
330-
jobject ret = env->NewObject(g_resultClass, g_suggestConstructor, name.get(), suggest.get(), ll.lat, ll.lon, ranges.get());
330+
jobject ret = env->NewObject(g_resultClass, g_suggestConstructor, name.get(), suggest.get(), ll.m_lat, ll.m_lon, ranges.get());
331331
ASSERT(ret, ());
332332
return ret;
333333
}
@@ -365,7 +365,7 @@ jobject ToJavaResult(Result & result, search::ProductInfo const & productInfo, b
365365
g_popularityConstructor,
366366
static_cast<jint>(result.GetRankingInfo().m_popularity)));
367367
jobject ret =
368-
env->NewObject(g_resultClass, g_resultConstructor, name.get(), desc.get(), ll.lat, ll.lon,
368+
env->NewObject(g_resultClass, g_resultConstructor, name.get(), desc.get(), ll.m_lat, ll.m_lon,
369369
ranges.get(), result.IsHotel(), productInfo.m_isLocalAdsCustomer,
370370
popularity.get());
371371
ASSERT(ret, ());

android/jni/com/mapswithme/maps/UserMarkHelper.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ jobject CreateMapObject(JNIEnv * env, place_page::Info const & info)
207207
{
208208
return CreateMapObject(env, info.GetID().GetMwmName(), info.GetID().GetMwmVersion(),
209209
info.GetID().m_index, kMyPosition, info.GetTitle(),
210-
info.GetSecondaryTitle(), info.GetSubtitle(), ll.lat, ll.lon,
210+
info.GetSecondaryTitle(), info.GetSubtitle(), ll.m_lat, ll.m_lon,
211211
info.GetAddress(), {}, "", jbanners.get(), jTaxiTypes.get(),
212212
info.GetBookingSearchUrl(), localAdInfo.get(), routingPointInfo.get(),
213213
info.GetOpeningMode(), info.ShouldShowUGC(), info.CanBeRated(),
@@ -219,7 +219,7 @@ jobject CreateMapObject(JNIEnv * env, place_page::Info const & info)
219219
{
220220
return CreateMapObject(
221221
env, info.GetID().GetMwmName(), info.GetID().GetMwmVersion(), info.GetID().m_index,
222-
kApiPoint, info.GetTitle(), info.GetSecondaryTitle(), info.GetSubtitle(), ll.lat, ll.lon,
222+
kApiPoint, info.GetTitle(), info.GetSecondaryTitle(), info.GetSubtitle(), ll.m_lat, ll.m_lon,
223223
info.GetAddress(), info.GetMetadata(), info.GetApiUrl(), jbanners.get(), jTaxiTypes.get(),
224224
info.GetBookingSearchUrl(), localAdInfo.get(), routingPointInfo.get(), info.GetOpeningMode(),
225225
info.ShouldShowUGC(), info.CanBeRated(), info.CanBeReviewed(), jratings.get(),
@@ -228,7 +228,7 @@ jobject CreateMapObject(JNIEnv * env, place_page::Info const & info)
228228

229229
return CreateMapObject(
230230
env, info.GetID().GetMwmName(), info.GetID().GetMwmVersion(), info.GetID().m_index, kPoi,
231-
info.GetTitle(), info.GetSecondaryTitle(), info.GetSubtitle(), ll.lat, ll.lon,
231+
info.GetTitle(), info.GetSecondaryTitle(), info.GetSubtitle(), ll.m_lat, ll.m_lon,
232232
info.GetAddress(), info.IsFeature() ? info.GetMetadata() : Metadata(), "", jbanners.get(),
233233
jTaxiTypes.get(), info.GetBookingSearchUrl(), localAdInfo.get(), routingPointInfo.get(),
234234
info.GetOpeningMode(), info.ShouldShowUGC(), info.CanBeRated(), info.CanBeReviewed(),

coding/coding_tests/traffic_test.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ double CalculateLength(vector<TrafficGPSEncoder::DataPoint> const & path)
2121
double res = 0;
2222
for (size_t i = 1; i < path.size(); ++i)
2323
{
24-
auto p1 = MercatorBounds::FromLatLon(path[i - 1].m_latLon.lat, path[i - 1].m_latLon.lon);
25-
auto p2 = MercatorBounds::FromLatLon(path[i].m_latLon.lat, path[i].m_latLon.lon);
24+
auto p1 = MercatorBounds::FromLatLon(path[i - 1].m_latLon.m_lat, path[i - 1].m_latLon.m_lon);
25+
auto p2 = MercatorBounds::FromLatLon(path[i].m_latLon.m_lat, path[i].m_latLon.m_lon);
2626
res += MercatorBounds::DistanceOnEarth(p1, p2);
2727
}
2828
return res;
@@ -48,10 +48,10 @@ void Test(vector<TrafficGPSEncoder::DataPoint> & points)
4848
{
4949
TEST_EQUAL(points[i].m_timestamp, result[i].m_timestamp,
5050
(points[i].m_timestamp, result[i].m_timestamp));
51-
TEST(base::AlmostEqualAbsOrRel(points[i].m_latLon.lat, result[i].m_latLon.lat, kEps),
52-
(points[i].m_latLon.lat, result[i].m_latLon.lat));
53-
TEST(base::AlmostEqualAbsOrRel(points[i].m_latLon.lon, result[i].m_latLon.lon, kEps),
54-
(points[i].m_latLon.lon, result[i].m_latLon.lon));
51+
TEST(base::AlmostEqualAbsOrRel(points[i].m_latLon.m_lat, result[i].m_latLon.m_lat, kEps),
52+
(points[i].m_latLon.m_lat, result[i].m_latLon.m_lat));
53+
TEST(base::AlmostEqualAbsOrRel(points[i].m_latLon.m_lon, result[i].m_latLon.m_lon, kEps),
54+
(points[i].m_latLon.m_lon, result[i].m_latLon.m_lon));
5555
}
5656

5757
if (version == TrafficGPSEncoder::kLatestVersion)

coding/serdes_json.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ class SerializerJson
165165
void operator()(ms::LatLon const & ll, char const * name = nullptr)
166166
{
167167
NewScopeWith(base::NewJSONObject(), name, [this, &ll] {
168-
(*this)(ll.lat, "lat");
169-
(*this)(ll.lon, "lon");
168+
(*this)(ll.m_lat, "lat");
169+
(*this)(ll.m_lon, "lon");
170170
});
171171
}
172172

@@ -374,8 +374,8 @@ class DeserializerJson
374374
void operator()(ms::LatLon & ll, char const * name = nullptr)
375375
{
376376
json_t * outerContext = SaveContext(name);
377-
(*this)(ll.lat, "lat");
378-
(*this)(ll.lon, "lon");
377+
(*this)(ll.m_lat, "lat");
378+
(*this)(ll.m_lon, "lon");
379379
RestoreContext(outerContext);
380380
}
381381

coding/traffic.hpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ class TrafficGPSEncoder
8888
if (!points.empty())
8989
{
9090
uint64_t const firstTimestamp = points[0].m_timestamp;
91-
uint32_t const firstLat = DoubleToUint32(points[0].m_latLon.lat, ms::LatLon::kMinLat,
91+
uint32_t const firstLat = DoubleToUint32(points[0].m_latLon.m_lat, ms::LatLon::kMinLat,
9292
ms::LatLon::kMaxLat, kCoordBits);
93-
uint32_t const firstLon = DoubleToUint32(points[0].m_latLon.lon, ms::LatLon::kMinLon,
93+
uint32_t const firstLon = DoubleToUint32(points[0].m_latLon.m_lon, ms::LatLon::kMinLon,
9494
ms::LatLon::kMaxLon, kCoordBits);
9595
WriteVarUint(writer, firstTimestamp);
9696
WriteVarUint(writer, firstLat);
@@ -102,9 +102,9 @@ class TrafficGPSEncoder
102102
ASSERT_LESS_OR_EQUAL(points[i - 1].m_timestamp, points[i].m_timestamp, ());
103103

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

110110
WriteVarUint(writer, deltaTimestamp);
@@ -125,9 +125,9 @@ class TrafficGPSEncoder
125125
if (!points.empty())
126126
{
127127
uint64_t const firstTimestamp = points[0].m_timestamp;
128-
uint32_t const firstLat = DoubleToUint32(points[0].m_latLon.lat, ms::LatLon::kMinLat,
128+
uint32_t const firstLat = DoubleToUint32(points[0].m_latLon.m_lat, ms::LatLon::kMinLat,
129129
ms::LatLon::kMaxLat, kCoordBits);
130-
uint32_t const firstLon = DoubleToUint32(points[0].m_latLon.lon, ms::LatLon::kMinLon,
130+
uint32_t const firstLon = DoubleToUint32(points[0].m_latLon.m_lon, ms::LatLon::kMinLon,
131131
ms::LatLon::kMaxLon, kCoordBits);
132132
uint32_t const traffic = points[0].m_traffic;
133133
WriteVarUint(writer, firstTimestamp);
@@ -141,9 +141,9 @@ class TrafficGPSEncoder
141141
ASSERT_LESS_OR_EQUAL(points[i - 1].m_timestamp, points[i].m_timestamp, ());
142142

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

149149
uint32_t const traffic = points[i - 1].m_traffic;

editor/changeset_wrapper.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ m2::RectD GetBoundingRect(vector<m2::PointD> const & geometry)
2929
for (auto const & p : geometry)
3030
{
3131
auto const latLon = MercatorBounds::ToLatLon(p);
32-
rect.Add({latLon.lon, latLon.lat});
32+
rect.Add({latLon.m_lon, latLon.m_lat});
3333
}
3434
return rect;
3535
}
@@ -132,7 +132,7 @@ ChangesetWrapper::~ChangesetWrapper()
132132
void ChangesetWrapper::LoadXmlFromOSM(ms::LatLon const & ll, pugi::xml_document & doc,
133133
double radiusInMeters)
134134
{
135-
auto const response = m_api.GetXmlFeaturesAtLatLon(ll.lat, ll.lon, radiusInMeters);
135+
auto const response = m_api.GetXmlFeaturesAtLatLon(ll.m_lat, ll.m_lon, radiusInMeters);
136136
if (response.first != OsmOAuth::HTTP::OK)
137137
MYTHROW(HttpErrorException, ("HTTP error", response, "with GetXmlFeaturesAtLatLon", ll));
138138

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

editor/editor_notes.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ bool LoadFromXml(pugi::xml_document const & xml, std::list<editor::Note> & notes
3939

4040
auto const node = xNode.node();
4141
auto const lat = node.attribute("lat");
42-
if (!lat || !strings::to_double(lat.value(), latLon.lat))
42+
if (!lat || !strings::to_double(lat.value(), latLon.m_lat))
4343
continue;
4444

4545
auto const lon = node.attribute("lon");
46-
if (!lon || !strings::to_double(lon.value(), latLon.lon))
46+
if (!lon || !strings::to_double(lon.value(), latLon.m_lon))
4747
continue;
4848

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

6868
node.append_attribute("lat") =
69-
strings::to_string_dac(note.m_point.lat, kDigitsAfterComma).data();
69+
strings::to_string_dac(note.m_point.m_lat, kDigitsAfterComma).data();
7070
node.append_attribute("lon") =
71-
strings::to_string_dac(note.m_point.lon, kDigitsAfterComma).data();
71+
strings::to_string_dac(note.m_point.m_lon, kDigitsAfterComma).data();
7272
node.append_attribute("text") = note.m_note.data();
7373
}
7474
}
@@ -144,7 +144,7 @@ void Notes::CreateNote(ms::LatLon const & latLon, std::string const & text)
144144
return;
145145
}
146146

147-
if (!MercatorBounds::ValidLat(latLon.lat) || !MercatorBounds::ValidLon(latLon.lon))
147+
if (!MercatorBounds::ValidLat(latLon.m_lat) || !MercatorBounds::ValidLon(latLon.m_lon))
148148
{
149149
LOG(LWARNING, ("A note attached to a wrong latLon", latLon));
150150
return;

editor/osm_editor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ void Editor::UploadChanges(string const & key, string const & secret, ChangesetT
814814
{"our", ourDebugFeatureString},
815815
{"mwm", fti.m_object.GetID().GetMwmName()},
816816
{"mwm_version", strings::to_string(fti.m_object.GetID().GetMwmVersion())}},
817-
alohalytics::Location::FromLatLon(ll.lat, ll.lon));
817+
alohalytics::Location::FromLatLon(ll.m_lat, ll.m_lon));
818818
}
819819

820820
GetPlatform().RunTask(Platform::Thread::Gui,

editor/server_api.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ void ServerApi06::CloseChangeSet(uint64_t changesetId) const
122122
uint64_t ServerApi06::CreateNote(ms::LatLon const & ll, std::string const & message) const
123123
{
124124
CHECK(!message.empty(), ("Note content should not be empty."));
125-
std::string const params = "?lat=" + strings::to_string_dac(ll.lat, 7) +
126-
"&lon=" + strings::to_string_dac(ll.lon, 7) +
125+
std::string const params = "?lat=" + strings::to_string_dac(ll.m_lat, 7) +
126+
"&lon=" + strings::to_string_dac(ll.m_lon, 7) +
127127
"&text=" + UrlEncode(message + " #mapsme");
128128
OsmOAuth::Response const response = m_auth.Request("/notes" + params, "POST");
129129
if (response.first != OsmOAuth::HTTP::OK)
@@ -200,7 +200,7 @@ OsmOAuth::Response ServerApi06::GetXmlFeaturesAtLatLon(double lat, double lon, d
200200

201201
OsmOAuth::Response ServerApi06::GetXmlFeaturesAtLatLon(ms::LatLon const & ll, double radiusInMeters) const
202202
{
203-
return GetXmlFeaturesAtLatLon(ll.lat, ll.lon, radiusInMeters);
203+
return GetXmlFeaturesAtLatLon(ll.m_lat, ll.m_lon, radiusInMeters);
204204
}
205205

206206
} // namespace osm

editor/xml_feature.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ pugi::xml_node FindTag(pugi::xml_document const & document, string const & key)
4040
ms::LatLon GetLatLonFromNode(pugi::xml_node const & node)
4141
{
4242
ms::LatLon ll;
43-
if (!strings::to_double(node.attribute("lat").value(), ll.lat))
43+
if (!strings::to_double(node.attribute("lat").value(), ll.m_lat))
4444
{
4545
MYTHROW(editor::NoLatLon,
4646
("Can't parse lat attribute:", string(node.attribute("lat").value())));
4747
}
48-
if (!strings::to_double(node.attribute("lon").value(), ll.lon))
48+
if (!strings::to_double(node.attribute("lon").value(), ll.m_lon))
4949
{
5050
MYTHROW(editor::NoLatLon,
5151
("Can't parse lon attribute:", string(node.attribute("lon").value())));
@@ -203,8 +203,8 @@ ms::LatLon XMLFeature::GetCenter() const
203203
void XMLFeature::SetCenter(ms::LatLon const & ll)
204204
{
205205
ASSERT_EQUAL(GetType(), Type::Node, ());
206-
SetAttribute("lat", strings::to_string_dac(ll.lat, kLatLonTolerance));
207-
SetAttribute("lon", strings::to_string_dac(ll.lon, kLatLonTolerance));
206+
SetAttribute("lat", strings::to_string_dac(ll.m_lat, kLatLonTolerance));
207+
SetAttribute("lon", strings::to_string_dac(ll.m_lon, kLatLonTolerance));
208208
}
209209

210210
void XMLFeature::SetCenter(m2::PointD const & mercatorCenter)

feature_list/feature_list.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ bool HasAtm(FeatureType & f)
124124
string BuildUniqueId(ms::LatLon const & coords, string const & name)
125125
{
126126
ostringstream ss;
127-
ss << strings::to_string_with_digits_after_comma(coords.lat, 6) << ','
128-
<< strings::to_string_with_digits_after_comma(coords.lon, 6) << ',' << name;
127+
ss << strings::to_string_with_digits_after_comma(coords.m_lat, 6) << ','
128+
<< strings::to_string_with_digits_after_comma(coords.m_lon, 6) << ',' << name;
129129
uint32_t hash = 0;
130130
for (char const c : ss.str())
131131
hash = hash * 101 + c;
@@ -238,8 +238,8 @@ class Processor
238238
osmId = f.GetMetadata().Get(feature::Metadata::FMD_SPONSORED_ID) + "00";
239239
}
240240
string const & uid = BuildUniqueId(ll, name);
241-
string const & lat = strings::to_string_with_digits_after_comma(ll.lat, 6);
242-
string const & lon = strings::to_string_with_digits_after_comma(ll.lon, 6);
241+
string const & lat = strings::to_string_with_digits_after_comma(ll.m_lat, 6);
242+
string const & lon = strings::to_string_with_digits_after_comma(ll.m_lon, 6);
243243
search::ReverseGeocoder::Address addr;
244244
string addrStreet = "";
245245
string addrHouse = "";

generator/booking_dataset.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ BookingHotel::BookingHotel(std::string const & src)
2525

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

3131
m_name = rec[FieldIndex(Fields::Name)];
3232
m_address = rec[FieldIndex(Fields::Address)];
@@ -87,7 +87,7 @@ void BookingDataset::BuildObject(Object const & hotel,
8787
{
8888
FeatureBuilder1 fb;
8989

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

9292
auto & metadata = fb.GetMetadata();
9393
metadata.Set(feature::Metadata::FMD_SPONSORED_ID, strings::to_string(hotel.m_id.Get()));

generator/booking_quality_check/booking_quality_check.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ string PrintBuilder(FeatureBuilder1 const & fb)
6969
s << "Address: " << address << '\t';
7070

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

7474
if (fb.GetGeomType() == feature::GeomType::Point)
7575
s << "GeomType: Point";
@@ -229,8 +229,8 @@ void GenerateFactors(Dataset const & dataset,
229229
ost << "# " << PrintBuilder(feature) << endl;
230230
ost << "# " << object << endl;
231231
ost << "# URL: https://www.openstreetmap.org/?mlat="
232-
<< object.m_latLon.lat << "&mlon=" << object.m_latLon.lon << "#map=18/"
233-
<< object.m_latLon.lat << "/" << object.m_latLon.lon << endl;
232+
<< object.m_latLon.m_lat << "&mlon=" << object.m_latLon.m_lon << "#map=18/"
233+
<< object.m_latLon.m_lat << "/" << object.m_latLon.m_lon << endl;
234234
}
235235
}
236236

@@ -281,8 +281,8 @@ void GenerateSample(Dataset const & dataset,
281281
outStream << "# " << PrintBuilder(fb) << endl;
282282
outStream << "# " << object << endl;
283283
outStream << "# URL: https://www.openstreetmap.org/?mlat="
284-
<< object.m_latLon.lat << "&mlon=" << object.m_latLon.lon
285-
<< "#map=18/" << object.m_latLon.lat << "/" << object.m_latLon.lon << endl;
284+
<< object.m_latLon.m_lat << "&mlon=" << object.m_latLon.m_lon
285+
<< "#map=18/" << object.m_latLon.m_lat << "/" << object.m_latLon.m_lon << endl;
286286
}
287287
if (!sponsoredIndexes.empty())
288288
outStream << endl << endl;

generator/borders.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ void UnpackBorders(string const & baseDir, string const & targetDir)
263263
for (auto p : points)
264264
{
265265
ms::LatLon const ll = MercatorBounds::ToLatLon(p);
266-
poly << " " << scientific << ll.lon << " " << ll.lat << endl;
266+
poly << " " << scientific << ll.m_lon << " " << ll.m_lat << endl;
267267
}
268268
poly << "END" << endl;
269269
}

generator/extract_addr/extract_addr.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ void PrintFeature(FeatureBuilder1 const & fb, uint64_t)
5252

5353
auto const center = MercatorBounds::ToLatLon(fb.GetKeyPoint());
5454
auto coordinates = base::NewJSONArray();
55-
ToJSONArray(*coordinates, std::round(center.lon * kRoundDigits) / kRoundDigits);
56-
ToJSONArray(*coordinates, std::round(center.lat * kRoundDigits) / kRoundDigits);
55+
ToJSONArray(*coordinates, std::round(center.m_lon * kRoundDigits) / kRoundDigits);
56+
ToJSONArray(*coordinates, std::round(center.m_lat * kRoundDigits) / kRoundDigits);
5757
auto geometry = base::NewJSONObject();
5858
ToJSONObject(*geometry, "type", "Point");
5959
ToJSONObject(*geometry, "coordinates", coordinates);

0 commit comments

Comments
 (0)