#17614 closed defect (fixed)
Some polygon intersections are ignored
Reported by: | GerdP | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 19.04 |
Component: | Core | Version: | |
Keywords: | template_report | Cc: | Don-vip, Klumbumbus |
Description
What steps will reproduce the problem?
- Run validator on the attached osm file
What is the expected result?
Validator should report "Overlapping Identical Natural Areas" for the two rectangles in the upper left area like for those on the right.
What happens instead?
The rather large overlap in the upper left area is ignored, we also allow to create a multipolygon
and if you verify that mp the overlap is detected because a different test is used.
Please provide any additional information below. Attach a screenshot if possible.
I think there are two reasons:
- First is that
Geometry.polygonIntersection(Area a1, Area a2, double eps)
use Rectangle instead of Rectangle2D - Second is that the default value 1 for eps is far too high, no matter if the area is in EastNorth or LatLon. My understanding is that the eps value should be chosen so that we ignore really small overlaps which could disappear after rounding to OSM precision, so maybe 1e-7 for LatLon areas.
I am still trying to find out the proper value for EastNorth.
URL:https://josm.openstreetmap.de/svn/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2019-03-31 21:17:00 +0200 (Sun, 31 Mar 2019) Build-Date:2019-03-31 20:25:18 Revision:14945 Relative:URL: ^/trunk Identification: JOSM/1.5 (14945 de) Windows 10 64-Bit OS Build number: Windows 10 Home 1803 (17134) Memory Usage: 370 MB / 1820 MB (160 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_20190416_100731.jfr] Dataset consistency test: No problems found Last errors/warnings: - W: No configuration settings found. Using hardcoded default values for all pools.
Attachments (5)
Change History (10)
by , 6 years ago
comment:1 by , 6 years ago
Cc: | added |
---|
by , 6 years ago
Attachment: | 17614.patch added |
---|
comment:2 by , 6 years ago
by , 6 years ago
Attachment: | overlap-v-shape.osm added |
---|
Problem case small overlap with clearly crossing ways
by , 6 years ago
Attachment: | 17614-v2a.patch added |
---|
unit test didn't match data in overlap-v-shape.osm
follow-up: 5 comment:3 by , 6 years ago
Cc: | added |
---|
Please load overlap-v-shape.osm and zoom to the outer right and left nodes. There are two small overlaps but clearly crossing ways.
Without the patch JOSM shows Warnings for overlapping areas, but this warning disappears when you merge the two points on the left.
With patch it will ignore the overlaps in both situations because both are smaller than the epsilon value.
The only way to improve that is to use a very small epsilon like 1e-10.
@Vincent: You introduced this eps with 1.0 in r5522. Do you remember why?
I think I remember that sometimes the method java.awt.geom.Area.intersect(Area rhs)
calculates small intersections because of rounding errors, but never with such a large error.
Please review!
Another problem that appeared while testing:
When areas intersect at different places each intersection area might be very small but the rectangle of the intersection area can be large. The attached patch fixes this as well.
The patch changes