Modify

Opened 10 days ago

Closed 5 days ago

#20110 closed defect (fixed)

"Update multipolygon" strips natural=coastline from member ways

Reported by: DoctorSpeck Owned by: GerdP
Priority: normal Milestone: 20.12
Component: Core Version:
Keywords: template_report Cc: Zverikk

Description

What steps will reproduce the problem?

  1. download map data that has a water or wetland multipolygon that has member ways tagged with natural=coastline ex: https://www.openstreetmap.org/relation/8246560
  2. draw a new way that will become an inner way
  3. select the relation by holding shift and double clicking in the multipolygon
  4. update the multipolygon using the "update multipolygon" tool (ctrl+shift+B on windows).
  5. observe that natural=coastline has been stripped from member ways

What is the expected result?

the new feature will be added to the multipolygon with appropriate inner/outer roles, and existing member ways retain their previous tagging ie. natural=coastline

What happens instead?

any member ways that have natural=coastline individually tagged, will be stripped after the "update multipolygon" command.

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

Sparse editing can cause broken coastline as the user may not be notified of a broken coastline if adjacent coastline segments are not downloaded (it will pass verification checks). This leaves the user to try to remember where the coastline was previously or inadvertently break coastline continuity.

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-10-03 13:42:38 +0200 (Sat, 03 Oct 2020)
Revision:17084
Build-Date:2020-10-04 01:30:47
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (17084 en) Windows 10 64-Bit
OS Build number: Windows 10 Pro 2009 (19042)
Memory Usage: 1936 MB / 4096 MB (1346 MB allocated, but free)
Java version: 11.0.8+10, AdoptOpenJDK, OpenJDK 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920x1200 (scaling 1.0x1.0), \Display1 1680x1050 (scaling 1.0x1.0), \Display2 1680x1050 (scaling 1.0x1.0)
Maximum Screen Size: 1920x1200
Best cursor sizes: 16x16 -> 32x32, 32x32 -> 32x32

Plugins:
+ BuildingGeneralization (23)
+ CADTools (1008)
+ CommandLine (35583)
+ EasyPresets (1604762161)
+ FastDraw (35499)
+ ImproveWay (29)
+ RelationDissolve (0.2.0)
+ RoadSigns (35510)
+ ShapeTools (1240)
+ SimplifyArea (35579)
+ alignways (35583)
+ apache-commons (35524)
+ apache-http (35092)
+ auto_tools (73)
+ buildings_tools (35579)
+ conflation (0.6.6)
+ ejml (35313)
+ ext_tools (35499)
+ flatlaf (35572)
+ geotools (35169)
+ imagery_offset_db (35405)
+ jaxb (35092)
+ jna (35092)
+ jts (35122)
+ mapwithai (1.7.0)
+ measurement (35579)
+ opendata (35513)
+ reltoolbox (35602)
+ reverter (35638)
+ strava_heatmap (1.0)
+ tageditor (35258)
+ terracer (35579)
+ todo (30306)
+ turnlanes (35405)
+ turnlanes-tagging (288)
+ turnrestrictions (35583)
+ utilsplugin2 (35624)
+ wikipedia (1.1.4)

Tagging presets:
+ https://raw.githubusercontent.com/OpenNauticalChart/josm/master/Presets_Hafen.xml
+ https://josm.openstreetmap.de/josmfile?page=Presets/Historical_Objects&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Industrial&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/LaneAttributes&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/ParkingLanes&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Playground_Equipment&zip=1
+ https://raw.githubusercontent.com/yopaseopor/traffic_signs_preset_JOSM/master/US.zip
+ https://josm.openstreetmap.de/josmfile?page=Presets/BuildingPreset&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Community_Centre&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Disc_Golf_Course&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Golf_Course&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Heritage&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/hiking_routes_with_trail_marking&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Maxspeed-zones&zip=1
+ https://raw.githubusercontent.com/OpenNauticalChart/josm/master/INT-1-preset.xml
+ https://josm.openstreetmap.de/josmfile?page=Presets/OpenSeaMap-PresetForSeamarks&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/AdvertisingPreset&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Camp_site_extends&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Healthcare&zip=1
+ https://raw.githubusercontent.com/osmlab/name-suggestion-index/master/dist/name-suggestions.presets.xml
+ https://josm.openstreetmap.de/josmfile?page=Presets/NewTags&zip=1
+ https://raw.githubusercontent.com/species/josm-preset-wheelchair/master/sidewalks_kerbs.xml
+ https://josm.openstreetmap.de/josmfile?page=Presets/OneClick&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/MastAndTower&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/TurnLanes&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/OpenSeaMap_bridge&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Mountains&zip=1

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/Modified&zip=1
+ https://pasharm.github.io/New_basic_style_for_JOSM/New_basic_style.mapcss
- https://github.com/bastik/mapcss-tools/raw/osm/mapnik2mapcss/osm-results/mapnik.zip
- http://kolesar.turistautak.hu/osm/opencellid/api/styles/measurements.mapcss
- https://josm.openstreetmap.de/josmfile?page=Styles/Schools&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Sidewalks&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Cycleways&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Enhanced_Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Incline&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_features&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_features_ryg&zip=1
- https://raw.githubusercontent.com/OpenSidewalks/OpenSidewalks-Schema/master/open_sidewalks.mapcss
- https://josm.openstreetmap.de/josmfile?page=Styles/ParkingLanes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Bench&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Admin_Boundaries&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Landcover&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Maxspeed&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/TigerReviewedNo&zip=1
- https://github.com/hotosm/HDM-JOSM-style/archive/master.zip
- https://josm.openstreetmap.de/josmfile?page=Styles/MapWithAI&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/IconTester&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/iD&zip=1
- https://github.com/osmlab/appledata/archive/josm_paint_inline_validation.zip
- https://josm.openstreetmap.de/josmfile?page=Styles/Surface&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/HiDPISupport&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Surface-DataEntry&zip=1
- https://github.com/gmgeo/osmic-josm-style/archive/master.zip
- https://josm.openstreetmap.de/josmfile?page=Styles/Mountains&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/LayerChecker&zip=1
- https://www.openrailwaymap.org/styles/josm-additional.zip
- https://www.openrailwaymap.org/styles/standard.zip

Last errors/warnings:
- 00001.427 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF'
- 00001.427 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF'
- 00009.810 W: Failed to delete outdated plugin '<josm.pref>\plugins\flatlaf.jar'.
- 00009.810 W: Failed to install already downloaded plugin 'flatlaf'. Skipping installation. JOSM is still going to load the old plugin version.
- 00015.541 W: java.io.IOException: The requested URL http://kolesar.turistautak.hu/osm/opencellid/api/styles/measurements.mapcss was not found
- 00016.929 W: Failed to load Mappaint styles from 'http://kolesar.turistautak.hu/osm/opencellid/api/styles/measurements.mapcss'. Exception was: java.io.IOException: The requested URL http://kolesar.turistautak.hu/osm/opencellid/api/styles/measurements.mapcss was not found
- 00016.929 E: java.io.IOException: The requested URL http://kolesar.turistautak.hu/osm/opencellid/api/styles/measurements.mapcss was not found
- 00021.131 W: javax.imageio.IIOException: Caught exception during read:. Cause: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
- 00021.131 E: Failed to locate image 'traffic_signs_presets/tunnel.png'
- 00021.131 W:  Tunnel: Could not get presets icon traffic_signs_presets/tunnel.png

Attachments (1)

20110.patch (4.8 KB) - added by GerdP 10 days ago.
patch and unit test

Download all attachments as: .zip

Change History (6)

comment:1 Changed 10 days ago by GerdP

Owner: changed from team to GerdP
Status: newassigned

This also happens if you just select a way of the multipolygon and use ctrl+shift+B to update. There is code to prevent this but it doesn't seem to work.

comment:2 Changed 10 days ago by GerdP

Cc: Zverikk added

@Zverikk: For r5225 the problematic code was copied from Reltoolbox plugin.
The following small patch fixes the problem in this ticket and passes all unit tests in CreateMultipolygonActionTest

  • src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java

     
    416416                for (String key : way.keySet()) {
    417417                    if (!values.containsKey(key)) { //relation values take precedence
    418418                        values.put(key, way.get(key));
    419                     } else if (!relation.hasKey(key) && !values.get(key).equals(way.get(key))) {
     419                    } else if (!values.get(key).equals(way.get(key))) {
    420420                        conflictingKeys.add(key);
    421421                    }
    422422                }

Do you remember why you added "!relation.hasKey(key)"?
Similar code exists in the block following the comment

filter out empty key conflicts - we need second iteration

I don't understand what this block is about. Is it even possible to have empty keys? Comment is missleading. It's about tags which don't appear in all outer ways

Last edited 10 days ago by GerdP (previous) (diff)

Changed 10 days ago by GerdP

Attachment: 20110.patch added

patch and unit test

comment:3 Changed 10 days ago by GerdP

Milestone: 20.11

comment:4 Changed 7 days ago by Don-vip

Milestone: 20.1120.12

Milestone renamed

comment:5 Changed 5 days ago by GerdP

Resolution: fixed
Status: assignedclosed

In 17343/josm:

fix #20110: "Update multipolygon" strips natural=coastline from member ways

  • fix and unit test

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain GerdP.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.