Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[editor] Building levels support in the core. #2670

Merged
merged 6 commits into from Apr 6, 2016

Conversation

biodranik
Copy link
Collaborator

No description provided.

@biodranik
Copy link
Collaborator Author

DUDE JTTP

<type id="building" can_add="no">
<!-- Buildings are at the bottom, to have lower priority. -->
<!-- Mergeable means that this type fields should be mixed with any other "main" type -->
<type id="building" can_add="no" mergeable="yes">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

То есть, решили не мёржить всё подряд?

@biodranik biodranik force-pushed the building-levels-support branch 2 times, most recently from 2191496 to 0245a28 Compare April 1, 2016 11:14
@biodranik
Copy link
Collaborator Author

@Zverik PTAL DUDE JTTP

@@ -113,6 +113,21 @@ UniString Normalize(UniString const & s)
return result;
}

void NormalizeDigits(string & utf8String)
{
for (ssize_t i = 0; i < static_cast<ssize_t>(utf8String.size()) - 2; ++i)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем ssize_t, зачем static_cast ??
Лучше size_t i = 2; i < size(); { внутри писать i-2, i-1, i }

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for (size_t i = 0; i + 2 < utf8.size(); ++i)
Заодно s/utf8String/utf8/

@biodranik
Copy link
Collaborator Author

@Zverik @vng @mpimenov поправил все замечания, PTAL DUDE JTTP

outDesc.m_address = isBuilding = true;
outDesc.m_editableFields.push_back(feature::Metadata::FMD_BUILDING_LEVELS);
outDesc.m_editableFields.push_back(feature::Metadata::FMD_POSTCODE);
classificatorTypes.erase(it);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вот эта строчка зачем? Она не сломает какой-то важный список в приложении?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Эта строчка убирает заматчившийся building из вектора всех типов фичи, чтобы по нему зря не бегать дальше в циклах.

On Apr 1, 2016, at 16:02, Ilya Zverev notifications@github.com wrote:

In editor/editor_config.cpp #2670 (comment):

                                   TypeAggregatedDescription & outDesc) const

{

  • bool isBuilding = false;
  • for (auto it = classificatorTypes.begin(); it != classificatorTypes.end(); ++it)
  • {
  • if (*it == "building")
  • {
  •  outDesc.m_address = isBuilding = true;
    
  •  outDesc.m_editableFields.push_back(feature::Metadata::FMD_BUILDING_LEVELS);
    
  •  outDesc.m_editableFields.push_back(feature::Metadata::FMD_POSTCODE);
    
  •  classificatorTypes.erase(it);
    
    Вот эта строчка зачем? Она не сломает какой-то важный список в приложении?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub https://github.com/mapsme/omim/pull/2670/files/af10e69d522742081c4007f6da63a022705f438b#r58201922

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это не повлияет на отображение зданий?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет, это временный вектор, который создается перед вызовом этой функции только с одной целью - передать в нее список типов фичи.

On Apr 1, 2016, at 16:51, Ilya Zverev notifications@github.com wrote:

In editor/editor_config.cpp #2670 (comment):

                                   TypeAggregatedDescription & outDesc) const

{

  • bool isBuilding = false;
  • for (auto it = classificatorTypes.begin(); it != classificatorTypes.end(); ++it)
  • {
  • if (*it == "building")
  • {
  •  outDesc.m_address = isBuilding = true;
    
  •  outDesc.m_editableFields.push_back(feature::Metadata::FMD_BUILDING_LEVELS);
    
  •  outDesc.m_editableFields.push_back(feature::Metadata::FMD_POSTCODE);
    
  •  classificatorTypes.erase(it);
    
    Это не повлияет на отображение зданий?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub https://github.com/mapsme/omim/pull/2670/files/af10e69d522742081c4007f6da63a022705f438b#r58207848

@mpimenov
Copy link
Collaborator

mpimenov commented Apr 1, 2016

LGTM

1 similar comment
@Zverik
Copy link
Contributor

Zverik commented Apr 1, 2016

LGTM


UNIT_TEST(NormalizeDigits)
{
auto const ND = [](string str) -> string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nd

@biodranik
Copy link
Collaborator Author

@ygorshenin @vng PTAL & merge please.

@biodranik
Copy link
Collaborator Author

@ygorshenin @vng PTAL & merge please.
DUDE JTTP

return {};
return strings::to_string_dac(d, 1);
// https://en.wikipedia.org/wiki/List_of_tallest_buildings_in_the_world
auto constexpr kMaxBuildingLevelsInTheWorld = 167;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Т.е. наша прога сломается с очередным арабским небоскребом? Зачем как-то ограничивать это чиселко?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Чтобы фильтровать мусор из осма, где может быть всё, что угодно.

On 4.4.2016, at 18.29, ygorshenin notifications@github.com wrote:

In generator/osm2meta.cpp:

{

  • double d;
  • if (!strings::to_double(v, d) || d == 0)
  • return {};
  • return strings::to_string_dac(d, 1);
  • // https://en.wikipedia.org/wiki/List_of_tallest_buildings_in_the_world
  • auto constexpr kMaxBuildingLevelsInTheWorld = 167;
    Т.е. наша прога сломается с очередным арабским небоскребом? Зачем как-то ограничивать это чиселко?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Чтобы фильтровать мусор из осма достаточно проверить что передано число, а не что передано число до 167.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Превышающие значения будут не около 168, а за 500: это скажется и на нашем рендеринге (наверное, я не проверял), и ещё, может, на чём-нибудь. Не вижу ничего плохого в том, чтобы проверять.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@biodranik
Copy link
Collaborator Author

@ygorshenin @vng PTAL
DUDE JTTP

@biodranik
Copy link
Collaborator Author

Падают не мои тесты, они уже пофикшены в мастере, но мой реквест еще фикс не включает.

@vng
Copy link
Collaborator

vng commented Apr 5, 2016

LGTM

1 similar comment
@ygorshenin
Copy link
Contributor

LGTM

@ygorshenin ygorshenin merged commit 8a83e58 into mapsme:master Apr 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants