Modify

Opened 5 months ago

Closed 5 months ago

#17745 closed defect (fixed)

Unexpected result from element of (∉) with unclosed ways

Reported by: GerdP Owned by: team
Priority: normal Milestone: 19.05
Component: Core Version:
Keywords: template_report Cc:

Description (last modified by GerdP)

What steps will reproduce the problem?

  1. See example hw-in-building.osm attached to ticket:10391
  2. Open Search dialog in expert mode and select "MapCSS selector"
  3. Enter
    *[highway]  area[building]
    

What is the expected result?

The three examples all have a highway within a building. I think it would be good when JOSM would find all three buildings.

What happens instead?

The building in the middle is selected.

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

The problem is in the java code: The selectors don't detect that they use "polygon" methods with unclosed ways and the "polygon" methods simply draw a line from the last point to the first and thus create a closed way before calculating the results.
In r15031 this is also true for unclosed ways matching the right selectors.
In r15102 the problem only exists for the left selectors.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2019-04-28 04:36:41 +0200 (Sun, 28 Apr 2019)
Build-Date:2019-04-28 02:37:58
Revision:15031
Relative:URL: ^/trunk

Identification: JOSM/1.5 (15031 en) Windows 10 64-Bit
OS Build number: Windows 10 Home 1803 (17134)
Memory Usage: 558 MB / 1820 MB (337 MB allocated, but free)
Java version: 1.8.0_201-b09, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: \Display0 1920x1080
Maximum Screen Size: 1920x1080
VM arguments: [-XX:StartFlightRecording=name=MyRecording2,settings=d:\dbg\gerd.jfc, -XX:FlightRecorderOptions=defaultrecording=true,dumponexit=true,dumponexitpath=e:\ld\perf_20190523_061454.jfr]
Dataset consistency test: No problems found

Plugins:
+ OpeningHoursEditor (34977)
+ apache-commons (34908)
+ buildings_tools (34982)
+ continuosDownload (82)
+ ejml (34908)
+ geotools (34908)
+ jaxb (34908)
+ jts (34908)
+ o5m (34908)
+ opendata (34997)
+ pbf (34908)
+ poly (34991)
+ reverter (34999)
+ undelete (34977)
+ utilsplugin2 (34977)

Validator rules:
+ c:\josm\core\data\validator\geometry.mapcss

Last errors/warnings:
- W: No configuration settings found.  Using hardcoded default values for all pools.

Attachments (1)

17745.patch (3.7 KB) - added by GerdP 5 months ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 5 months ago by GerdP

Description: modified (diff)

Changed 5 months ago by GerdP

Attachment: 17745.patch added

comment:2 Changed 5 months ago by GerdP

Milestone: 19.05

The attached patch changes JOSM so that unclosed ways or multipolygons with unclosed outer rings are never considered to be inside a polygon. If I hear no complains I'll commit this on saturday as a work around.

I think the better solution would be to have an algorithm that works with unclosed ways like this:
Regard the way as a collection of all the points which are on the line segments. If all points are inside or on the edges of the polygon the way is inside the polygon. In other words: If any of the points is outside of the polygon it is not inside.
The existing code in MultipolygonTest might be a base for that new algorithm...

comment:3 Changed 5 months ago by GerdP

In 15107/josm:

see #17745: ignore unclosed ways and multipolygons with unclosed outer rings in methods Geometry.filterInsidePolygon() and Geometry.filterInsideMultipolygon()
TODO: implement correct algorithm for unclosed ways

comment:4 Changed 5 months ago by GerdP

Resolution: fixed
Status: newclosed

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.

Add Comment


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

 
Note: See TracTickets for help on using tickets.