Modify

Opened 4 years ago

Last modified 20 months ago

#20054 new enhancement

Overlapping areas: Allow areas inside areas sharing segments

Reported by: skyper Owned by: team
Priority: normal Milestone:
Component: Core validator Version:
Keywords: template_report overlap area inside Cc: Don-vip, dieterdreist

Description (last modified by skyper)

What steps will reproduce the problem?

  1. Have an area with an area inside, sharing a segment but not crossing. I have a building-MP inside an amenity, see josm_area_inside_area_shared_segment.osm.
  2. Run validator

What is the expected result?

No warning

What happens instead?

Info warning: Overlapping Areas

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

These overlaps like a building inside an amenity are correct. There is no other way to map it than having shared segments.

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-11-08 17:34:30 +0100 (Sun, 08 Nov 2020)
Revision:17304
Build-Date:2020-11-09 02:30:51
URL:https://josm.openstreetmap.de/svn/trunk

Attachments (7)

josm_area_inside_area_shared_segment.osm (12.9 KB ) - added by skyper 4 years ago.
simple example
josm_area_inside_area_shared_segment-mod.osm (13.1 KB ) - added by GerdP 4 years ago.
slightly modified
inter.gpx (3.7 KB ) - added by GerdP 4 years ago.
a1.gpx (1.3 KB ) - added by GerdP 4 years ago.
a2.gpx (3.6 KB ) - added by GerdP 4 years ago.
20054-simple-sample.osm (1.7 KB ) - added by GerdP 4 years ago.
very simple example which produces wrong "overlapping areas" message
20054.patch (1.9 KB ) - added by GerdP 4 years ago.

Download all attachments as: .zip

Change History (22)

comment:1 by skyper, 4 years ago

Description: modified (diff)

comment:2 by skyper, 4 years ago

Component: CoreCore validator

by skyper, 4 years ago

simple example

comment:3 by skyper, 4 years ago

According to trunk/resources/data/validator/geometry.mapcss:

area:closed:areaStyle  area:closed:areaStyle {
  throwOther: tr("Overlapping Areas");
}

So this test simply checks area inside area but the warning is in my eyes irritating.

by GerdP, 4 years ago

slightly modified

comment:4 by GerdP, 4 years ago

I think what you see is the effect of the strange definition of "insideness" in java shapes, maybe combined with rounding errors. My modified example should either give the same info (or better both should not) but results are different.

comment:5 by skyper, 4 years ago

Yes, simply moving a node seems to quite validator. Means this is a bug.

by GerdP, 4 years ago

Attachment: inter.gpx added

by GerdP, 4 years ago

Attachment: a1.gpx added

by GerdP, 4 years ago

Attachment: a2.gpx added

comment:6 by GerdP, 4 years ago

Yes, it's a bug, but probably not one that we can solve. JOSM calculates the intersection of the areas using the method
java.awt.geom.Area.intersect(Area rhs).

        Area inter = new Area(a1);
        inter.intersect(a2);

Later it checks if the intersection equals the original area, and this returns false for your example and true for mine.
The reason is that the intersect method produces two extra points with nearly 0 distance. I've created some debug code to visualize the different shapes, see attached gpx files. If you compare a2.gpx with inter.gpx in a diff program you find the extra points. This bug exists as long as I am working with this class and I am pretty sure that it is known. No idea how to find out. If anybody thinks it can help I can write a standalone java code to prove it.

comment:7 by GerdP, 4 years ago

Cc: Don-vip added

@Vincent: Do you know how to find out if this is a known java bug?

comment:8 by skyper, 4 years ago

Still do not understand what this rule should flag. The message says Overlapping Areas but the test is about areas inside areas. But there is no problem with a building inside an amenity.

comment:9 by GerdP, 4 years ago

The test doesn't care about the type of the areas. For real overlaps it just means that two areas cover the same place. Nobody says that this is wrong. On the other hand we don't have a rule for each combination of areas that must not overlap, so this is a one for all rule.

comment:10 by GerdP, 4 years ago

the test is about areas inside areas

No, it's about crossing/overlapping areas

in reply to:  10 comment:11 by skyper, 4 years ago

Replying to GerdP:

the test is about areas inside areas

No, it's about crossing/overlapping areas

I see, real overlap but not touching. Thanks.

by GerdP, 4 years ago

Attachment: 20054-simple-sample.osm added

very simple example which produces wrong "overlapping areas" message

by GerdP, 4 years ago

Attachment: 20054.patch added

comment:12 by GerdP, 4 years ago

The patch fixes both problems but requires additional - typically slow - calculations. Possible alternative would be to replace the area.equals() tests completely by these additional tests. Have to do some tests reg. performance.
With the patch some crossing areas are no longer found.

Last edited 4 years ago by GerdP (previous) (diff)

comment:13 by GerdP, 3 years ago

Ticket #20911 has been marked as a duplicate of this ticket.

comment:14 by GerdP, 20 months ago

Ticket #22815 has been marked as a duplicate of this ticket.

comment:15 by skyper, 20 months ago

Cc: dieterdreist added

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to skyper.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


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