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
Conversation
|
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"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
То есть, решили не мёржить всё подряд?
2191496
to
0245a28
Compare
|
@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) | |||
There was a problem hiding this comment.
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 }
There was a problem hiding this comment.
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/
0245a28
to
af10e69
Compare
| 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вот эта строчка зачем? Она не сломает какой-то важный список в приложении?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это не повлияет на отображение зданий?
There was a problem hiding this comment.
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
|
LGTM |
1 similar comment
|
LGTM |
|
|
||
| UNIT_TEST(NormalizeDigits) | ||
| { | ||
| auto const ND = [](string str) -> string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nd
af10e69
to
48f13c5
Compare
|
@ygorshenin @vng PTAL & merge please. |
|
@ygorshenin @vng PTAL & merge please. |
| return {}; | ||
| return strings::to_string_dac(d, 1); | ||
| // https://en.wikipedia.org/wiki/List_of_tallest_buildings_in_the_world | ||
| auto constexpr kMaxBuildingLevelsInTheWorld = 167; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Т.е. наша прога сломается с очередным арабским небоскребом? Зачем как-то ограничивать это чиселко?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Чтобы фильтровать мусор из осма достаточно проверить что передано число, а не что передано число до 167.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Превышающие значения будут не около 168, а за 500: это скажется и на нашем рендеринге (наверное, я не проверял), и ещё, может, на чём-нибудь. Не вижу ничего плохого в том, чтобы проверять.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
f95ce43
to
baf4a0c
Compare
|
@ygorshenin @vng PTAL |
|
Падают не мои тесты, они уже пофикшены в мастере, но мой реквест еще фикс не включает. |
|
LGTM |
1 similar comment
|
LGTM |
No description provided.