#13086 closed enhancement (fixed)
[Patch] Detect all self-intersecting ways (multipolygons, less common tags, etc.)
Reported by: | naoliv | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 16.10 |
Component: | Core validator | Version: | |
Keywords: | Cc: | stephankn |
Description
While searching for objects with invalid geometries (using ST_IsValid()
with a database) I saw that some objects aren't reported as wrong/invalid in JOSM.
For example, validating the attached file in JOSM nothing is displayed, while I can see a Self-intersection at or near point -49.642125 -21.152750000000001
from ST_IsValid()
Search for problem=yes
in the attached file and you should see the intersection.
Shouldn't JOSM catch intersections like this?
JOSM:
Build-Date:2016-06-28 00:41:59 Revision:10501 Is-Local-Build:true Identification: JOSM/1.5 (10501 SVN pt_BR) Linux Debian GNU/Linux testing (stretch) Memory Usage: 247 MB / 10206 MB (63 MB allocated, but free) Java version: 1.8.0_91-8u91-b14-2-b14, Oracle Corporation, OpenJDK 64-Bit Server VM VM arguments: [-Dawt.useSystemAAFontSettings=on] Dataset consistency test: No problems found
Attachments (5)
Change History (27)
by , 9 years ago
Attachment: | self-intersect.osm added |
---|
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Summary: | Not detecting self-intersecting multipolygons → Detect all self-intersecting ways (multipolygons, less common tags, etc.) |
---|
comment:5 by , 9 years ago
I've already posted a patch for multipolygons, see #13307. I think we have to add a test similar to CrossingWays
to the SelfIntersectingWay
test and maybe filter those self-intersections in the other tests so that they are not reported twice.
Will look into this.
by , 9 years ago
Attachment: | 13086.patch added |
---|
comment:6 by , 9 years ago
Summary: | Detect all self-intersecting ways (multipolygons, less common tags, etc.) → [Patch] Detect all self-intersecting ways (multipolygons, less common tags, etc.) |
---|
comment:7 by , 9 years ago
I've added a patch which
1) improves SelfIntersectingWay
so that it also finds 2self intersections at first or last node, Unit test added
2) improves CrossingWays
to check each way for self-intersection
One open problem: Should we use the same error code for both ? I think no, but did not yet find a good description.
Once the way crosses itself without a node at the intersection, once there is a node.
Will post a modified patch for #13307 as well.
by , 9 years ago
Attachment: | 13086_v2.patch added |
---|
comment:8 by , 9 years ago
I've noticed that the first patch replaced a warning like "crossing barriers" by "Self-intersecting ways". This was not intended. The new patch fixes this and uses the message "Self-crossing ways" instead of "Self-intersecting ways".
I can also create a unit test similar to that for coastlines if needed.
comment:10 by , 9 years ago
Cc: | added |
---|
comment:12 by , 8 years ago
Milestone: | → 16.10 |
---|
comment:13 by , 8 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
There is a false positive validator warning for ways which end at a node, which is part of the way and not the first node. This is a common case for highway=* e.g. way/209238741
Since I can't remember to see this warning before I assume this patch introduced it.
comment:14 by , 8 years ago
Agreed, this is generally not an error.
@Gerd Petermann: I think we should revert the part of the patch for SelfIntersectingWay.java
and adapt the tests.
comment:15 by , 8 years ago
Yes, I also wondered if highway=* should be treated special. I'll have a look at it tomorrow.
comment:16 by , 8 years ago
This is not specific to highways. I think all linear features can have such a shape (railways, barrier,...).
For linear features it should not warn and for areas and multipolygons such a case will be catched by ohter warnings (uncloses area / unclosed multipolygon). So I don't see a need for a warning for this case.
by , 8 years ago
Attachment: | first_and_last.osm added |
---|
comment:17 by , 8 years ago
Please comment the case in new attachment first_and_last.osm
Should this be flagged or not? I think if the p-shaped ways are okay than this is also no problem?
by , 8 years ago
Attachment: | 13086_mod.patch added |
---|
follow-up: 20 comment:18 by , 8 years ago
The patch 13086_mod.patch allows p-shaped and 8-shaped (as in first_and_last.osm) linear ways when the intersection node is first or last node of the way (or both) and modifies the unit tests accordingly.
comment:20 by , 8 years ago
Replying to Gerd Petermann <gpetermann_muenchen@…>:
The patch 13086_mod.patch allows p-shaped and 8-shaped (as in first_and_last.osm) linear ways when the intersection node is first or last node of the way (or both) and modifies the unit tests accordingly.
Thanks, I would say the 8-shape is unusual, but not necessarily wrong. Maybe a Validator report at INFO-level would be okay. (But not for the P-shaped highways and barriers, ... They are too common.)
comment:21 by , 8 years ago
I think we should keep it as is now. I don't think we need the 8-shape info level warnig. I assume this would produce more false positives than real errors.
see also #12843