[generator] Replace params.flats with metadata string, also do not skip seamarks

This commit is contained in:
Ilya Zverev 2015-10-29 17:08:56 +03:00
parent 586ebdf5b6
commit 0595c04b5b
6 changed files with 11 additions and 6 deletions

View file

@ -207,9 +207,6 @@ bool FeatureBuilder1::PreSerialize()
if (!m_params.IsValid())
return false;
/// @todo Do not use flats info. Maybe in future.
m_params.flats.clear();
switch (m_params.GetGeomType())
{
case GEOM_POINT:

View file

@ -117,6 +117,12 @@ public:
if (!value.empty())
md.Add(Metadata::FMD_WIKIPEDIA, value);
}
else if (k == "addr:flats")
{
string const & value = ValidateAndFormat_flats(v);
if (!value.empty())
md.Add(Metadata::FMD_FLATS, value);
}
return false;
}
@ -203,6 +209,10 @@ protected:
{
return v;
}
string ValidateAndFormat_flats(string const & v) const
{
return v;
}
// Special URL encoding for wikipedia:
// Replaces special characters with %HH codes

View file

@ -524,7 +524,6 @@ namespace ftype
{ "building", "entrance", [](string & k, string & v) { k.swap(v); v = "yes"; }},
{ "addr:housename", "*", [&params](string & k, string & v) { params.AddHouseName(v); k.clear(); v.clear(); }},
{ "addr:street", "*", [&params](string & k, string & v) { params.AddStreetAddress(v); k.clear(); v.clear(); }},
{ "addr:flats", "*", [&params](string & k, string & v) { params.flats = v; k.clear(); v.clear(); }},
{ "addr:housenumber", "*", [&params](string & k, string & v)
{
// Treat "numbers" like names if it's not an actual number.

View file

@ -43,7 +43,6 @@ void OsmElement::AddTag(string const & k, string const & v)
// Skip tags for speedup, now we don't use it
SKIP_KEY("not:");
SKIP_KEY("seamark"); // http://wiki.openstreetmap.org/wiki/OpenSeaMap/Seamark_Tag_Values
SKIP_KEY("artist_name");
SKIP_KEY("whitewater"); // http://wiki.openstreetmap.org/wiki/Whitewater_sports

View file

@ -121,7 +121,6 @@ struct FeatureParamsBase
StringUtf8Multilang name;
StringNumericOptimal house;
string ref;
string flats;
int8_t layer;
uint8_t rank;

View file

@ -36,6 +36,7 @@ namespace feature
FMD_POSTCODE = 15,
FMD_WIKIPEDIA = 16,
FMD_MAXSPEED = 17,
FMD_FLATS = 18,
FMD_COUNT
};