// License: GPL. For details, see LICENSE file. package org.openstreetmap.josm.gui.layer; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; import org.openstreetmap.josm.testutils.JOSMTestRules; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; /** * Unit tests of {@link NoteLayer} class. */ class NoteLayerTest { /** * Setup tests */ @RegisterExtension @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") public JOSMTestRules test = new JOSMTestRules(); /** * Non-regression test for ticket #13208. */ @Test void testTicket13208() { assertEquals("0 notes", new NoteLayer().getToolTipText()); } /** * Unit test of {@link NoteLayer#insertLineBreaks}. */ @Test void testInsertLineBreaks() { // empty string assertEquals("", NoteLayer.insertLineBreaks("")); // CHECKSTYLE.OFF: LineLength // https://www.openstreetmap.org/note/278197: long text with periods assertEquals("Note 278197
Klumbumbus on Nov 29, 2014:
Hier soll eine zusätzliche Rechtsabbiegerspur entstehen.
Müsste dann bei Fertigstellung nochmal geprüft und die lanes angepoasst werden.
http://www.sachsen-fernsehen.de/Aktuell/Chemnitz/Artikel/1370077/Bauarbeiten-auf-Chemnitzer-Hartmannstrasse-beginnen/
Saxonyking on May 4, 2015:
Danke
eingetragen", NoteLayer.insertLineBreaks( "Note 278197
Klumbumbus on Nov 29, 2014:
Hier soll eine zusätzliche Rechtsabbiegerspur entstehen. Müsste dann bei Fertigstellung nochmal geprüft und die lanes angepoasst werden. http://www.sachsen-fernsehen.de/Aktuell/Chemnitz/Artikel/1370077/Bauarbeiten-auf-Chemnitzer-Hartmannstrasse-beginnen/
Saxonyking on May 4, 2015:
Danke
eingetragen")); // https://www.openstreetmap.org/note/1196942: long text without periods (question marks instead) assertEquals("Note 1196942
Mateusz Konieczny on Nov 6, 2017:
https://www.openstreetmap.org/way/51661050#map=17/50.9326393/14.0821931layers=N Why this is not tagged as highway=steps?
What is the meaning of steps=yes here?
See http://overpass-turbo.eu/s/sLv for more cases (I considered armchair mapping it to highway=steps but I think that verification from local mappers is preferable)", NoteLayer.insertLineBreaks( "Note 1196942
Mateusz Konieczny on Nov 6, 2017:
https://www.openstreetmap.org/way/51661050#map=17/50.9326393/14.0821931layers=N Why this is not tagged as highway=steps? What is the meaning of steps=yes here? See http://overpass-turbo.eu/s/sLv for more cases (I considered armchair mapping it to highway=steps but I think that verification from local mappers is preferable)")); // https://www.openstreetmap.org/note/1029364: several spaces between sentence mark and next sentence assertEquals("Note 1029364
SaGm on Jun 13, 2017:
HOW CAN I CONNECT THIS ROUD TO THE MAIN ROUDS?

if i make a GPX trail its SKIP this way.

dsh4 on Jun 14, 2017:
To connect roads, they need to have a node in common.
This is already the case here: the footway has nodes in common with Idan and with Katsenelson.
Thus, in that respect, the map is correct.
If your router doesn't use the new footway, it would be better to ask about that elsewhere, see http://wiki.openstreetmap.org/wiki/Contact_channels .
(Notes are only really suited for discussing errors in the map, and there isn't an error in the map here.)

The footway is also a member of two turn restrictions that forbid turning from Katsenelson onto the footway.
Presumably pedestrians are allowed to enter the footway from Katsenelson, so those restrictions are wrong and should be deleted.

Cheers!
SaGm on Jun 14, 2017:
Thanks Dsh4
How can i delet it?

dsh4 on Jun 14, 2017:
That depends on what editor program you use.
In JOSM, for example, you would click on the footway, then double-click on the turn restriction in the "Tags / Memberships" window on the right, and then click the trash can button in the pop-up window to delete the entire relation (not just the membership of the footway in the relation).
A web search ought to find instructions for your favourite editor as well.", NoteLayer.insertLineBreaks( "Note 1029364
SaGm on Jun 13, 2017:
HOW CAN I CONNECT THIS ROUD TO THE MAIN ROUDS?

if i make a GPX trail its SKIP this way.

dsh4 on Jun 14, 2017:
To connect roads, they need to have a node in common. This is already the case here: the footway has nodes in common with Idan and with Katsenelson. Thus, in that respect, the map is correct. If your router doesn't use the new footway, it would be better to ask about that elsewhere, see http://wiki.openstreetmap.org/wiki/Contact_channels . (Notes are only really suited for discussing errors in the map, and there isn't an error in the map here.)

The footway is also a member of two turn restrictions that forbid turning from Katsenelson onto the footway. Presumably pedestrians are allowed to enter the footway from Katsenelson, so those restrictions are wrong and should be deleted.

Cheers!
SaGm on Jun 14, 2017:
Thanks Dsh4
How can i delet it?

dsh4 on Jun 14, 2017:
That depends on what editor program you use. In JOSM, for example, you would click on the footway, then double-click on the turn restriction in the "Tags / Memberships" window on the right, and then click the trash can button in the pop-up window to delete the entire relation (not just the membership of the footway in the relation). A web search ought to find instructions for your favourite editor as well.")); // https://www.openstreetmap.org/note/230617: ideographic full stops assertEquals("Note 230617
deckkun on Aug 27, 2014:
筑紫が丘への抜け道?
Rakkka on Jul 20, 2017:
地図を修正するためのメモではないように見えますが、解決してもよろしいでしょうか?
<anonymous> on Jul 21, 2017:
そうです。
一部未舗装があり、急な坂があります。
細い部分もあるので自動車は無理です。

Rakkka on Jul 21, 2017:
この地点から北西へ伸びている道路のことですよね。
自動車道になっているので、自動車が通れないなら直さないといけませんが、通れない部分がわからないので、メモは残しておきます。

<anonymous> on Jul 21, 2017:
そうです。
マーク地点からですと白百合学園までは行けますが、そこから筑紫が丘六丁目7に出る付近は資材置き場があり、狭く、もしかしたら一部私有地内の通行になるのかも。
軽自動車なら行ける幅だと思いますが。
ストリートマップでイメージは掴めると思います。
", NoteLayer.insertLineBreaks( "Note 230617
deckkun on Aug 27, 2014:
筑紫が丘への抜け道?
Rakkka on Jul 20, 2017:
地図を修正するためのメモではないように見えますが、解決してもよろしいでしょうか?
<anonymous> on Jul 21, 2017:
そうです。一部未舗装があり、急な坂があります。細い部分もあるので自動車は無理です。
Rakkka on Jul 21, 2017:
この地点から北西へ伸びている道路のことですよね。自動車道になっているので、自動車が通れないなら直さないといけませんが、通れない部分がわからないので、メモは残しておきます。
<anonymous> on Jul 21, 2017:
そうです。マーク地点からですと白百合学園までは行けますが、そこから筑紫が丘六丁目7に出る付近は資材置き場があり、狭く、もしかしたら一部私有地内の通行になるのかも。軽自動車なら行ける幅だと思いますが。ストリートマップでイメージは掴めると思います。")); // CHECKSTYLE.ON: LineLength } /** * Unit test of {@link NoteLayer#replaceLinks}. */ @Test void testReplaceLinks() { // empty string assertEquals("", NoteLayer.replaceLinks("")); // no link assertEquals("no http link", NoteLayer.replaceLinks("no http link")); // just one link assertEquals("https://www.example.com/\u200btest", NoteLayer.replaceLinks("https://www.example.com/test")); // link with dot assertEquals("https://www.example.com.", NoteLayer.replaceLinks("https://www.example.com.")); // CHECKSTYLE.OFF: LineLength // text with several links (with and without slash) assertEquals("foo https://foo.example.com/\u200btest bar https://bar.example.com baz", NoteLayer.replaceLinks("foo https://foo.example.com/test bar https://bar.example.com baz")); // CHECKSTYLE.ON: LineLength } }