Issue 2052 wikipedia link from street relation #2622

Merged
root merged 10 commits from issue-2052-wikipedia-link-from-street into master 2022-05-31 11:40:09 +00:00
Member

Closes #2052

Added special case when associatedStreet relation has wikipedia tag then this tag should not be copied to relation members.

Closes #2052 Added special case when `associatedStreet` relation has `wikipedia` tag then this tag should not be copied to relation members.
strump reviewed 2022-05-26 09:07:22 +00:00
Author
Member

relation_tag.cpp code doesn't override ref tag of route members.
But in relation_tag.cpp line 93 ref tag is added. Looks like it's ignored.

I expect that road11 ref tag contains SP62;IT:RA/SP60 but it doesn't.

`relation_tag.cpp` code doesn't override `ref` tag of route members. But in [`relation_tag.cpp` line 93](https://github.com/organicmaps/organicmaps/blob/master/generator/relation_tags.cpp#L93=) ref tag is added. Looks like it's ignored. I expect that road11 `ref` tag contains `SP62;IT:RA/SP60` but it doesn't.
biodranik (Migrated from github.com) requested changes 2022-05-26 09:27:12 +00:00
biodranik (Migrated from github.com) left a comment

Thanks!

Thanks!
biodranik (Migrated from github.com) commented 2022-05-26 09:20:35 +00:00

What is the meaning of UNREACHABLE here? It it should not be called, please use CHECK(false, ("Should not be called"));

What is the meaning of UNREACHABLE here? It it should not be called, please use `CHECK(false, ("Should not be called"));`
biodranik (Migrated from github.com) commented 2022-05-26 09:21:53 +00:00

nit: it can be refactored to return std::optional instead of bool and element-by-reference.

nit: it can be refactored to return std::optional instead of bool and element-by-reference.
biodranik (Migrated from github.com) commented 2022-05-26 09:22:13 +00:00

One line please )

One line please )
biodranik (Migrated from github.com) commented 2022-05-26 09:22:52 +00:00

It fits into one line.

It fits into one line.
biodranik (Migrated from github.com) commented 2022-05-26 09:23:15 +00:00

One line.

One line.
biodranik (Migrated from github.com) commented 2022-05-26 09:23:18 +00:00

One line.

One line.
biodranik (Migrated from github.com) commented 2022-05-26 09:23:29 +00:00

One line.

One line.
biodranik (Migrated from github.com) commented 2022-05-26 09:23:42 +00:00

One line.

One line.
biodranik (Migrated from github.com) commented 2022-05-26 09:24:49 +00:00

One line. Or, if its too long, prefer the following syntax:

{
{},
{},
};

It allows inserting new values without modifying the first and last lines.

One line. Or, if its too long, prefer the following syntax: ``` { {}, {}, }; ``` It allows inserting new values without modifying the first and last lines.
biodranik (Migrated from github.com) commented 2022-05-26 09:25:00 +00:00

One line.

One line.
biodranik (Migrated from github.com) commented 2022-05-26 09:25:05 +00:00

One line.

One line.
@ -0,0 +7,4 @@
// TODO: Rewrite these tests using RelationTagsEnricher with some test mock of IntermediateDataReaderInterface.
namespace relation_tags_tests
{
using namespace feature;
biodranik (Migrated from github.com) commented 2022-05-26 09:19:31 +00:00

Please sort.

Please sort.
@ -100,7 +100,8 @@ void RelationTagsWay::Process(RelationElement const & e)
return;
bool const isBoundary = (type == "boundary") && IsAcceptBoundary(e);
biodranik (Migrated from github.com) commented 2022-05-26 09:26:42 +00:00
  bool const isAssociatedStreet = type == "associatedStreet";
  bool const processAssociatedStreet = isAssociatedStreet &&
                                       Base::IsKeyTagExists("addr:housenumber") &&
                                       !Base::IsKeyTagExists("addr:street");

to avoid unnecessary string comparison.

```suggestion bool const isAssociatedStreet = type == "associatedStreet"; bool const processAssociatedStreet = isAssociatedStreet && Base::IsKeyTagExists("addr:housenumber") && !Base::IsKeyTagExists("addr:street"); ``` to avoid unnecessary string comparison.
biodranik (Migrated from github.com) reviewed 2022-05-26 09:27:46 +00:00
biodranik (Migrated from github.com) commented 2022-05-26 09:27:46 +00:00

@vng please take a look

@vng please take a look
strump reviewed 2022-05-26 09:52:20 +00:00
@ -0,0 +7,4 @@
// TODO: Rewrite these tests using RelationTagsEnricher with some test mock of IntermediateDataReaderInterface.
namespace relation_tags_tests
{
using namespace feature;
Author
Member

Reordered.

Reordered.
strump reviewed 2022-05-26 09:53:32 +00:00
Author
Member

Replaced with CHECK(false, ...).
Also replaced in collector_building_parts_tests.cpp.

Replaced with `CHECK(false, ...)`. Also replaced in `collector_building_parts_tests.cpp`.
strump reviewed 2022-05-26 09:55:02 +00:00
Author
Member

Switch to optional wold be great. But it requires a lot of changes in intermediate_data.hpp, intermediate_data.cpp, etc. Not sure I am confident enough.

Switch to `optional` wold be great. But it requires a lot of changes in `intermediate_data.hpp`, `intermediate_data.cpp`, etc. Not sure I am confident enough.
strump reviewed 2022-05-26 09:55:14 +00:00
strump reviewed 2022-05-26 09:55:27 +00:00
Author
Member

Reformatted to single line

Reformatted to single line
strump reviewed 2022-05-26 09:55:36 +00:00
Author
Member

Reformatted to single line

Reformatted to single line
strump reviewed 2022-05-26 09:55:48 +00:00
Author
Member

Reformatted to single line

Reformatted to single line
strump reviewed 2022-05-26 09:55:56 +00:00
Author
Member

Reformatted to single line

Reformatted to single line
strump reviewed 2022-05-26 09:56:07 +00:00
Author
Member

Reformatted to single line.

Reformatted to single line.
strump reviewed 2022-05-26 09:56:17 +00:00
Author
Member

Reformatter to single line.

Reformatter to single line.
strump reviewed 2022-05-26 09:56:26 +00:00
Author
Member

Reformatter to single line.

Reformatter to single line.
strump reviewed 2022-05-26 09:56:35 +00:00
Author
Member

Reformatted to single line.

Reformatted to single line.
strump reviewed 2022-05-26 09:56:43 +00:00
@ -100,7 +100,8 @@ void RelationTagsWay::Process(RelationElement const & e)
return;
bool const isBoundary = (type == "boundary") && IsAcceptBoundary(e);
Author
Member

Fixed.

Fixed.
vng (Migrated from github.com) reviewed 2022-05-26 10:26:17 +00:00
vng (Migrated from github.com) left a comment

ToDo for @vng:
Current generator tests fixture looks ugly.
Should use RelationTagsEnricher with some test mock of IntermediateDataReaderInterface.

ToDo for @vng: Current generator tests fixture looks ugly. Should use RelationTagsEnricher with some test mock of IntermediateDataReaderInterface.
vng (Migrated from github.com) commented 2022-05-26 10:24:38 +00:00

Put todo here.

Put todo here.
vng commented 2022-05-26 10:27:42 +00:00 (Migrated from github.com)

Please, don't use KR braces style in C++ code:
bad:

UNIT_TEST() {
}

good:

UNIT_TEST()
{
}
Please, don't use KR braces style in C++ code: bad: ``` UNIT_TEST() { } ``` good: ``` UNIT_TEST() { } ```
Author
Member

@vng, what text should I add?

TEST_EQUAL(road11.GetTag("ref"), "SP62", ()); // TODO: Use RelationTagsEnricher with some test mock of IntermediateDataReaderInterface.
@vng, what text should I add? ```cpp TEST_EQUAL(road11.GetTag("ref"), "SP62", ()); // TODO: Use RelationTagsEnricher with some test mock of IntermediateDataReaderInterface. ```
vng commented 2022-05-26 10:34:54 +00:00 (Migrated from github.com)

ToDo:

  • check refs inheritance (expected "IT:RA/SP60;SP62")
  • rewrite this tests using RelationTagsEnricher with some test mock of IntermediateDataReaderInterface
ToDo: - check refs inheritance (expected "IT:RA/SP60;SP62") - rewrite this tests using RelationTagsEnricher with some test mock of IntermediateDataReaderInterface
vng (Migrated from github.com) approved these changes 2022-05-27 08:47:21 +00:00
vng commented 2022-05-27 08:48:16 +00:00 (Migrated from github.com)

@biodranik If you approve, I'd make squash-and-merge.

@biodranik If you approve, I'd make squash-and-merge.
biodranik (Migrated from github.com) approved these changes 2022-05-27 10:51:00 +00:00
biodranik (Migrated from github.com) commented 2022-05-27 10:47:52 +00:00
// TODO: Rewrite these tests using RelationTagsEnricher with some test mock of IntermediateDataReaderInterface.
```suggestion // TODO: Rewrite these tests using RelationTagsEnricher with some test mock of IntermediateDataReaderInterface. ```
biodranik (Migrated from github.com) commented 2022-05-27 10:48:27 +00:00

Выше есть using std; значит надо либо тут убрать, либо убрать using.

Выше есть using std; значит надо либо тут убрать, либо убрать using.
biodranik (Migrated from github.com) commented 2022-05-27 10:50:18 +00:00

Есть же using namespace generator. Лучше using namespace generator::cache; и тут укоротить запись. И дальше по коду аналогично.

Есть же using namespace generator. Лучше using namespace generator::cache; и тут укоротить запись. И дальше по коду аналогично.
biodranik (Migrated from github.com) commented 2022-05-27 10:50:49 +00:00

Или убрать вообще using и везде явно прописывать namespace.

Или убрать вообще using и везде явно прописывать namespace.
strump reviewed 2022-05-30 14:20:11 +00:00
Author
Member

Убрал using namespace std

Убрал `using namespace std`
strump reviewed 2022-05-30 14:22:34 +00:00
Author
Member

Из namespace generic берётся класс RelationTagsWay, который тестируется, и класс generator::cache::OSMElementCacheReaderInterface. Я оставил using namespace generator, но убрал generator:: из кода.

Из namespace generic берётся класс `RelationTagsWay`, который тестируется, и класс `generator::cache::OSMElementCacheReaderInterface`. Я оставил `using namespace generator`, но убрал `generator::` из кода.
strump reviewed 2022-05-30 14:23:01 +00:00
Author
Member

Исправил комментарий

Исправил комментарий
This repo is archived. You cannot comment on pull requests.
No reviewers
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No milestone
No project
No assignees
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: organicmaps/organicmaps-tmp#2622
No description provided.