Modify

Opened 2 months ago

Closed 2 months ago

Last modified 2 months ago

#23517 closed defect (fixed)

"Tools->Create multipolygon" sorts inner before outer

Reported by: nkamapper Owned by: GerdP
Priority: normal Milestone: 24.02
Component: Core Version:
Keywords: template_report Cc:

Description (last modified by nkamapper)

What steps will reproduce the problem?

  1. Choose two or more ways, forming a multipolygon.
  2. Select Tools->Create multipolygon.

What is the expected result?

Outer members sorted before inner members.
This is the standard way of sorting multipolygon in geojson, OGR etc. (and also in the Relation window of JOSM).

What happens instead?

Inner members sorted before outer members.
I then need to open the Relation window and sort correctly.

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

Revision:18969
Build-Date:2024-02-06 12:15:17

Identification: JOSM/1.5 (18969 en_GB) Mac OS X 12.7.2
OS Build number: macOS 12.7.2 (21G1974)
Memory Usage: 3640 MB / 8192 MB (2123 MB allocated, but free)
Java version: 17.0.10+7-LTS, Azul Systems, Inc., OpenJDK 64-Bit Server VM
Look and Feel: com.apple.laf.AquaLookAndFeel
Screen: Display 69733568 1440×900 (scaling 2.00×2.00)
Maximum Screen Size: 1440×900
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_GB
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djpackage.app-version=18969, --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:
+ PicLayer (1.0.3)
+ RelationDissolve (0.2.0)
+ apache-commons (36176)
+ apache-http (36176)
+ changeset-viewer (0.0.7)
+ conflation (0.6.11)
+ ejml (36176)
+ ext_tools (36126)
+ geotools (36176)
+ imagery-xml-bounds (36196)
+ jackson (36176)
+ jaxb (36118)
+ jna (36176)
+ jts (36004)
+ log4j (36176)
+ opendata (36200)
+ pdfimport (36200)
+ reverter (36196)
+ scripting (v0.3.1)
+ todo (137)
+ utilsplugin2 (36200)

Tagging presets:
+ https://josm.openstreetmap.de/josmfile?page=Presets/LaneAttributes&zip=1
+ https://raw.githubusercontent.com/OpenNauticalChart/josm/master/INT-1-preset.xml

Map paint styles:
+ https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
- https://raw.githubusercontent.com/OpenSeaMap/josm/master/CEVNI_MapCSS.mapcss
- https://raw.githubusercontent.com/OpenSeaMap/josm/master/INT1_Seamark.mapcss
- https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1

Last errors/warnings:
- 25982.201 W: Image not returned for tile: https://wms.geonorge.no/skwms1/wms.adm_enheter2?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=fylker_gjel,kommuner_gjel&STYLES=&SRS=EPSG:3857&WIDTH=1024&HEIGHT=1024&BBOX=1272982.2690613,8513785.5214878,1273058.7060896,8513861.9585161 content type was: application/vnd.ogc.se_xml;charset=ISO-8859-1
- 25982.202 W: Image not returned for tile: https://wms.geonorge.no/skwms1/wms.adm_enheter2?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=fylker_gjel,kommuner_gjel&STYLES=&SRS=EPSG:3857&WIDTH=1024&HEIGHT=1024&BBOX=1272982.2690613,8513785.5214878,1273058.7060896,8513861.9585161 content type was: application/vnd.ogc.se_xml;charset=ISO-8859-1
- 25982.224 W: Image not returned for tile: https://wms.geonorge.no/skwms1/wms.adm_enheter2?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=fylker_gjel,kommuner_gjel&STYLES=&SRS=EPSG:3857&WIDTH=1024&HEIGHT=1024&BBOX=1273058.7060896,8513709.0844595,1273135.1431179,8513785.5214878 content type was: application/vnd.ogc.se_xml;charset=ISO-8859-1
- 25982.224 W: Image not returned for tile: https://wms.geonorge.no/skwms1/wms.adm_enheter2?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=fylker_gjel,kommuner_gjel&STYLES=&SRS=EPSG:3857&WIDTH=1024&HEIGHT=1024&BBOX=1273058.7060896,8513709.0844595,1273135.1431179,8513785.5214878 content type was: application/vnd.ogc.se_xml;charset=ISO-8859-1
- 25982.239 W: Image not returned for tile: https://wms.geonorge.no/skwms1/wms.adm_enheter2?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=fylker_gjel,kommuner_gjel&STYLES=&SRS=EPSG:3857&WIDTH=1024&HEIGHT=1024&BBOX=1272982.2690613,8513709.0844595,1273058.7060896,8513785.5214878 content type was: application/vnd.ogc.se_xml;charset=ISO-8859-1
- 25982.239 W: Image not returned for tile: https://wms.geonorge.no/skwms1/wms.adm_enheter2?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=fylker_gjel,kommuner_gjel&STYLES=&SRS=EPSG:3857&WIDTH=1024&HEIGHT=1024&BBOX=1272982.2690613,8513709.0844595,1273058.7060896,8513785.5214878 content type was: application/vnd.ogc.se_xml;charset=ISO-8859-1
- 26185.017 W: java.net.SocketTimeoutException: Read timed out. Cause: java.net.SocketTimeoutException: Read timed out
- 26185.027 W: java.net.SocketTimeoutException: Read timed out. Cause: java.net.SocketTimeoutException: Read timed out
- 26216.816 W: java.net.SocketTimeoutException: Read timed out. Cause: java.net.SocketTimeoutException: Read timed out
- 26262.368 W: java.net.SocketTimeoutException: Read timed out. Cause: java.net.SocketTimeoutException: Read timed out

Attachments (2)

23517.patch (4.2 KB ) - added by GerdP 2 months ago.
reorder members so that all outer rings come first and for rings with same role those with more members come first
23517-alternative.patch (1.8 KB ) - added by GerdP 2 months ago.
sort in RelationSorter, outer rings first, no further sorting, only works when all members have either role "outer" or "inner"

Download all attachments as: .zip

Change History (9)

comment:1 by nkamapper, 2 months ago

Description: modified (diff)

comment:2 by GerdP, 2 months ago

Owner: changed from team to GerdP

comment:3 by GerdP, 2 months ago

I seem to remember that the Relation editor sorted members of multipolygons so that outer members come first but that isn't the case with current code. The code in CreateMultipolygonAction simply calls RelationSorter.sortMembersByConnectivity().
I'll try to find out more.

by GerdP, 2 months ago

Attachment: 23517.patch added

reorder members so that all outer rings come first and for rings with same role those with more members come first

by GerdP, 2 months ago

Attachment: 23517-alternative.patch added

sort in RelationSorter, outer rings first, no further sorting, only works when all members have either role "outer" or "inner"

comment:4 by GerdP, 2 months ago

Resolution: fixed
Status: newclosed

In 19001/josm:

fix #23517: "Tools->Create multipolygon" sorts inner before outer

  • reorder members so that all outer rings come first and for rings with same role those with more members come first (before calling RelationSorter.sortMembersByConnectivity())

comment:5 by nkamapper, 2 months ago

Thank you!

comment:6 by GerdP, 2 months ago

Milestone: 24.02

comment:7 by GerdP, 2 months ago

23517-alternative.patch for Relation Sorter is a quite ugly and incomplete, so I wait for comments from others if there is a better way to do that. Maybe open a new ticket for the relation editor dialog to also sort outer before inner. Up to now it just sorts so that rings are completed, but outer and inner roles are ignored.

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. 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.