Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/boundary intersection check test #458

Draft
wants to merge 36 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e038bbd
Implementation of Boundary Intersection Check.
Amon-Cyn Sep 28, 2020
e8691ff
Edge changed to LineItem.
Sep 29, 2020
256be1b
Renamed, finding intersections improved, test cases added.
Sep 30, 2020
264c480
Logic simplified.
Sep 30, 2020
6d9f368
Both lines intersecting are added.
Sep 30, 2020
a04097e
Tests updated.
Sep 30, 2020
2e397ee
Source relation added to flag.
Oct 1, 2020
b2ea161
Instruction check improved.
Oct 1, 2020
9e58a84
Intersection point added to instruction, regression causing duplicate…
Oct 1, 2020
c9c09d4
Checkstyle cleanup. Logic change to flag only once per relation pair.…
Oct 2, 2020
36e1909
Checkstyle cleanup. Splitted way are now logged together. Way tags ar…
Oct 5, 2020
8c9a8a4
Further grouping rework.
Oct 6, 2020
9fc6ff2
Checkstyle fixes.
Oct 6, 2020
406df70
RelationIntersections moved to separate class. Edges are now logging …
Oct 7, 2020
dd580cf
Clean up.
Oct 7, 2020
351524b
Boundaries with the same type fixed. Same for ways. Tests fixed. Chec…
Oct 12, 2020
ef708cc
BoundaryIntersectionCheck added to available_checks.md
Oct 13, 2020
387d561
SpotlessJava applied.
Oct 13, 2020
0c355be
Logging qualified objects to console and analyzing relation 2332402 a…
Oct 15, 2020
5777e35
MultiRelation and MultiLine handling.
Oct 26, 2020
10871c2
Tests fixed.
Oct 27, 2020
aacdd01
Parent relation included.
Oct 28, 2020
6353f6b
Line tags handling excluded.
Oct 28, 2020
630e603
Self way intersection fixed.
Nov 5, 2020
2843b7e
Crude logging added.
Nov 19, 2020
639b009
Working version.
Nov 27, 2020
f7c0dd6
Intersection and touching handling fixed to work for all combinations…
Dec 1, 2020
86741f0
Intersection and touching handling fixed to work for all combinations…
Dec 2, 2020
bb3d84d
All three cases of areas intersection are handled. There is still a p…
Dec 9, 2020
8b52d16
Not simple or not valid geometries are ignored.
Dec 9, 2020
ec26930
Improved check of line and area intersection.
Dec 15, 2020
3066a94
Further intersection logic improvement and tests fixes.
Dec 30, 2020
7cf2e02
Checkstyle corrections.
Jan 3, 2021
e2bcffa
Checkstyle ordering.
Jan 3, 2021
3fb516e
Checkstyle test.
Jan 3, 2021
ae79a97
Spotless java.
Jan 3, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions config/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@
}
}
},
"BoundaryIntersectionCheck": {
"challenge": {
"description": "Task contains Boundaries information describing their intersection",
"blurb": "Boundaries Intersecting",
"instruction": "Open your favorite editor, check the instruction and modify the points/ways that are causing boundaries to intersect.",
"difficulty": "NORMAL"
}
},
"BuildingRoadIntersectionCheck": {
"car.navigable": true,
"challenge": {
Expand Down
1 change: 1 addition & 0 deletions docs/available_checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ This document is a list of tables with a description and link to documentation f
## Relations
| Check Name | Check Description |
| :--------- | :---------------- |
| BoundaryIntersectionCheck | This check is designed to scan relations marked as boundaries or with ways marked as boundaries and flag them for intersections with other boundaries of the same type. |
| InvalidMultiPolygonRelationCheck | This check is designed to scan through MultiPolygon relations and flag them for invalid geometry. |
| [InvalidTurnRestrictionCheck](checks/invalidTurnRestrictionCheck.md) | The purpose of this check is to identify invalid turn restrictions in OSM. Invalid turn restrictions occur in a variety of ways from invalid members, Edge geometry issues, not being routable, or wrong topology. |
| [MissingRelationType](checks/missingRelationType.md) | The purpose of this check is to identify Relations without relation type. |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.openstreetmap.atlas.checks.utility;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import org.openstreetmap.atlas.geography.atlas.items.LineItem;
import org.openstreetmap.atlas.geography.atlas.items.Relation;

/**
* @author srachanski
*/
public class RelationIntersections
{

private final Map<Relation, Map<Long, Set<LineItem>>> intersections = new HashMap<>();

public void addIntersection(final Relation relation, final LineItem lineItem)
{
this.intersections.computeIfAbsent(relation, k -> new HashMap<>());
final long osmIdentifier = lineItem.getOsmIdentifier();
this.intersections.get(relation).computeIfAbsent(osmIdentifier, k -> new HashSet<>());
this.intersections.get(relation).get(osmIdentifier).add(lineItem);
}

public Map<Long, Set<LineItem>> getLineItemMap(final Relation relation)
{
return this.intersections.get(relation);
}

public Set<Relation> getRelations()
{
return this.intersections.keySet();
}

}
Loading