[generator] Fixed passing osm ids.

This commit is contained in:
vng 2014-09-18 20:05:31 +03:00 committed by Alex Zolotarev
parent aeae9bad11
commit 356cf0433b
3 changed files with 11 additions and 5 deletions

View file

@ -61,11 +61,10 @@ void FeatureBuilder1::AddPoint(m2::PointD const & p)
void FeatureBuilder1::SetLinear(bool reverseGeometry)
{
m_params.SetGeomType(feature::GEOM_LINE);
m_polygons.resize(1);
if (reverseGeometry)
{
ASSERT_EQUAL(m_polygons.size(), 1, ());
auto & cont = m_polygons.front();
ASSERT(!cont.empty(), ());
reverse(cont.begin(), cont.end());
@ -411,6 +410,11 @@ void FeatureBuilder1::AddOsmId(osm::Id id)
m_osmIds.push_back(id);
}
void FeatureBuilder1::SetOsmId(osm::Id id)
{
m_osmIds.assign(1, id);
}
string FeatureBuilder1::GetOsmIdsString() const
{
size_t const size = m_osmIds.size();

View file

@ -133,9 +133,12 @@ public:
/// Set all the parameters, except geometry type (it's set by other functions).
inline void SetParams(FeatureParams const & params) { m_params.SetParams(params); }
/// For OSM debugging, store original OSM id
/// @name For OSM debugging, store original OSM id
//@{
void AddOsmId(osm::Id id);
void SetOsmId(osm::Id id);
string GetOsmIdsString() const;
//@}
int GetMinFeatureDrawScale() const;

View file

@ -358,7 +358,7 @@ class SecondPassParserUsual : public SecondPassParserBase<TEmitter, THolder>
if (NeedWriteAddress(params) && ft.FormatFullAddress(addr))
m_addrWriter->Write(addr.c_str(), addr.size());
ft.AddOsmId(id);
ft.SetOsmId(id);
base_type::m_emitter(ft);
}
@ -378,7 +378,6 @@ class SecondPassParserUsual : public SecondPassParserBase<TEmitter, THolder>
feature::RemoveNoDrawableTypes(params.m_Types, feature::FEATURE_TYPE_LINE))
{
ft.SetLinear(params.m_reverseGeometry);
EmitFeatureBase(ft, params, osm::Id::Way(id));
}
}