[generator] Fix bug with normalizing boundary-administrative-4-state type in World.mwm

This commit is contained in:
vng 2012-06-05 10:57:47 -07:00 committed by Alex Zolotarev
parent ed61f145b5
commit 98efcc314a
3 changed files with 10 additions and 9 deletions

View file

@ -295,11 +295,6 @@ void FeatureTypesProcessor::SetMappingTypes(char const * arr1[2], char const * a
m_mapping[GetType(arr1, 2)] = GetType(arr2, 2);
}
void FeatureTypesProcessor::SetDontNormalizeType(char const * arr[3])
{
m_dontNormalize.insert(GetType(arr, 3));
}
MergedFeatureBuilder1 * FeatureTypesProcessor::operator() (FeatureBuilder1 const & fb)
{
MergedFeatureBuilder1 * p = new MergedFeatureBuilder1(fb);

View file

@ -108,7 +108,10 @@ public:
void SetMappingTypes(char const * arr1[2], char const * arr2[2]);
/// Leave original types, for example: boundary-administrative-2.
void SetDontNormalizeType(char const * arr[3]);
template <size_t N> void SetDontNormalizeType(char const * (&arr)[N])
{
m_dontNormalize.insert(GetType(arr, N));
}
MergedFeatureBuilder1 * operator() (FeatureBuilder1 const & fb);
};

View file

@ -49,14 +49,17 @@ public:
{
// Do not strip last types for given tags,
// for example, do not cut 'admin_level' in 'boundary-administrative-XXX'.
char const * arrDontNormalize[][3] = {
char const * arr3[][3] = {
{ "boundary", "administrative", "2" },
{ "boundary", "administrative", "3" },
{ "boundary", "administrative", "4" }
};
for (size_t i = 0; i < ARRAY_SIZE(arrDontNormalize); ++i)
m_typesCorrector.SetDontNormalizeType(arrDontNormalize[i]);
for (size_t i = 0; i < ARRAY_SIZE(arr3); ++i)
m_typesCorrector.SetDontNormalizeType(arr3[i]);
char const * arr4[] = { "boundary", "administrative", "4", "state" };
m_typesCorrector.SetDontNormalizeType(arr4);
}
void operator()(FeatureBuilder1 const & fb)