Modify

Opened 12 months ago

Closed 11 months ago

Last modified 11 months ago

#23308 closed defect (fixed)

[patch] False positive results for "Water area inside water area" validation

Reported by: b1tw153 Owned by: team
Priority: normal Milestone: 23.12
Component: Core validator Version:
Keywords: template_report water coastline Cc:

Description

What steps will reproduce the problem?

  1. Create a new layer in JOSM
  2. Create a closed counter-clockwise way and tag it with natural=coastline. This is an island.
  3. Create a second closed way inside the island and tag it with natural=water. This is a lake on the island.
  4. Click the Validation button

What is the expected result?

No validation warnings.

What happens instead?

There is a "Water area inside water area" warning for the two newly created ways.

Note that if you split the natural=coastline into two separate ways and rerun the validation, the warning goes away. The problem only occurs when the natural=coastline element is a single closed way.

Please provide any additional information below. Attach a screenshot if possible.

Revision:18822
Build-Date:2023-08-30 11:52:18

Identification: JOSM/1.5 (18822 en) Mac OS X 14.1.1
OS Build number: macOS 14.1.1 (23B81)
Memory Usage: 1360 MB / 8192 MB (445 MB allocated, but free)
Java version: 17.0.8+7-LTS, Azul Systems, Inc., OpenJDK 64-Bit Server VM
Look and Feel: com.apple.laf.AquaLookAndFeel
Screen: Display 188823026 2048×1152 (scaling 1.00×1.00)
Maximum Screen Size: 2048×1152
Best cursor sizes: 16×16→16×16, 32×32→32×32
System property file.encoding: UTF-8
System property sun.jnu.encoding: UTF-8
Locale info: en_US
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djpackage.app-version=18822, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED, --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED, --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED, --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, -Djpackage.app-path=/Applications/JOSM.app/Contents/MacOS/JOSM]
Dataset consistency test: No problems found

Plugins:
+ MicrosoftStreetside (36176)
+ apache-commons (36176)
+ apache-http (36176)
+ ejml (36176)
+ geotools (36176)
+ graphview (36178)
+ jackson (36176)
+ javafx (36178)
+ jaxb (36118)
+ jna (36176)
+ jts (36004)
+ log4j (36176)
+ mapwithai-dev (1.9.16-1-g89c7d89)
+ opendata (36186)
+ reverter (36126)
+ routing (36178)
+ turnlanes (36126)
+ utilsplugin2 (36178)
+ wikipedia (605)

Map paint styles:
+ https://josm.openstreetmap.de/josmfile?page=Styles/MapWithAI&zip=1
+ ${HOME}/Documents/JOSM/TIGER Cleanup.mapcss
+ ${HOME}/Documents/JOSM/Track Completeness.mapcss
+ ${HOME}/Documents/JOSM/GNIS Cleanup.mapcss

Validator rules:
+ ${HOME}/Desktop/GNIS Fixup Validator.mapcss

Last errors/warnings:
- 00010.065 W: Failed to add ${HOME}/Desktop/GNIS Fixup Validator.mapcss to tag checker
- 00010.066 W: java.nio.file.NoSuchFileException: ${HOME}/Desktop/GNIS Fixup Validator.mapcss
- 00011.733 E: Failed to locate image 'MapWithAI'
- 00040.048 W: java.net.SocketTimeoutException: Read timed out. Cause: java.net.SocketTimeoutException: Read timed out
- 00040.154 E: Failed to locate image 'https://www.fs.usda.gov/sites/all/themes/fs_hq/images/usfslogo.png'
- 00445.207 W: java.net.SocketTimeoutException: Read timed out. Cause: java.net.SocketTimeoutException: Read timed out
- 00445.208 W: Already here java.net.SocketTimeoutException: Read timed out
- 00445.309 E: Failed to locate image 'https://www.fs.usda.gov/sites/all/themes/fs_hq/images/usfslogo.png'

Attachments (1)

Water in Water Warning.osm (7.8 KB ) - added by b1tw153 12 months ago.
Sample data set to demonstrate false positive warning and the case where the warning is not generated.

Download all attachments as: .zip

Change History (8)

comment:1 by gaben, 12 months ago

Could you please upload an example dataset which triggers the error?

comment:2 by gaben, 12 months ago

Component: CoreCore validator

by b1tw153, 12 months ago

Attachment: Water in Water Warning.osm added

Sample data set to demonstrate false positive warning and the case where the warning is not generated.

comment:3 by gaben, 12 months ago

Keywords: water coastline added

Thank you!

See also #20306 and #21704.

comment:4 by gaben, 12 months ago

Summary: False positive results for "Water area inside water area" validation[patch] False positive results for "Water area inside water area" validation

There were duplicate warnings for crossing ways by the CrossingWay test and MapCSS validation. If you open the test data, move the coastlines on each other and merge the second, split coastline, you can check the behaviour.

  • resources/data/validator/geometry.mapcss

     
    198198}
    199199
    200200/* Overlapping areas (spatial test) */
    201 area[natural =~ /^(water|wetland|coastline)$/], area[waterway=riverbank], area[landuse=reservoir] {
     201area[natural =~ /^(water|wetland)$/], area[waterway=riverbank], area[landuse=reservoir] {
    202202  set water_area;
    203203}
    204204
     
    210210}
    211211
    212212/* Water area inside water area (spatial test) */
    213 area:closed[natural =~ /^(water|wetland|coastline)$/] ⊆  area:closed.water_area,
    214 area:closed[waterway=riverbank]                       ⊆  area:closed.water_area,
    215 area:closed[landuse=reservoir]                        ⊆  area:closed.water_area,
    216 area:closed[natural =~ /^(water|wetland|coastline)$/] ⊇  area:closed.water_area,
    217 area:closed[waterway=riverbank]                       ⊇  area:closed.water_area,
    218 area:closed[landuse=reservoir]                        ⊇  area:closed.water_area {
     213area:closed[natural =~ /^(water|wetland)$/] ⊆  area:closed.water_area,
     214area:closed[waterway=riverbank]             ⊆  area:closed.water_area,
     215area:closed[landuse=reservoir]              ⊆  area:closed.water_area,
     216area:closed[natural =~ /^(water|wetland)$/] ⊇  area:closed.water_area,
     217area:closed[waterway=riverbank]             ⊇  area:closed.water_area,
     218area:closed[landuse=reservoir]              ⊇  area:closed.water_area {
    219219  throwWarning: tr("Water area inside water area");
    220220}

Or if you still want a dedicated Overlapping Water Areas warning for coastlines, I can look for other approaches.

comment:5 by b1tw153, 12 months ago

I'm not sure I understand all the implications of these changes.

But it does seem that identifying a closed natural=coastline way as a water area was incorrect. The only closed ways with natural=coastline are islands, and the sense of the way has the water on the outside not the inside. (Unless the direction of the way is reversed, but there's a separate test for that.) Otherwise, ways with natural=coastline are unclosed, and so wouldn't trigger any of these tests.

comment:6 by taylor.smock, 11 months ago

Resolution: fixed
Status: newclosed

In 18921/josm:

Fix #23308: Fix a false positive for "Water area inside water area" validation (patch by gaben, modified)

A coastline as an area follows the right-side rule like coastlines as a way.
This means that a water area inside the area, as defined for almost every other
area tag, may be valid, depending upon the directionality of the coastline way.

Modifications are as follows:

  • Look for water areas inside oceans (coastline is drawn in clockwise direction)
    • This is anticipated to be a rare occurrence since most coastlines are expected to be part of a large area.
  • Add non-regression test
  • Keep previous spacing for easier svn blame usage

comment:7 by taylor.smock, 11 months ago

Milestone: 23.12

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.