Skip to content

Commit

Permalink
LCWB enhancement - borders,ferries,fords (osmlab#287)
Browse files Browse the repository at this point in the history
* better border relation flagging

* refine floating feature logix

* spotless

* new border tag attempt 1

* allow fording/ferry roads; edit border relation logic

* address comments, unit tests, small fixes

* add non offending nodes configurable

* bump test coverage

* add docs and take out nearest neighbor

Co-authored-by: Sean Coulter <[email protected]>
Co-authored-by: yiqingj <[email protected]>
Co-authored-by: Daniel B <[email protected]>
  • Loading branch information
4 people authored May 13, 2020
1 parent 51a6b81 commit 50748af
Show file tree
Hide file tree
Showing 5 changed files with 352 additions and 44 deletions.
3 changes: 2 additions & 1 deletion config/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,8 @@
"bus_guideway"
],
"lineItems.offending": "railway->rail,narrow_gauge,preserved,subway,disused,monorail,tram,light_rail,funicular,construction,miniature",
"lineItems.non_offending": "waterway->*|boundary->*|landuse->*|bridge->yes,viaduct,aqueduct,boardwalk,covered,low_water_crossing,movable,suspension|tunnel->yes,culvert,building_passage|embankment->yes|location->underwater,underground|power->line,minor_line|man_made->pier,breakwater,embankment,groyne,dyke,pipeline|route->ferry|highway->proposed,construction|ice_road->yes|ford->yes|winter_road->yes|snowmobile->yes|ski->yes",
"lineItems.non_offending": "waterway->*|boundary->*|landuse->*|bridge->yes,viaduct,aqueduct,boardwalk,covered,low_water_crossing,movable,suspension|tunnel->yes,culvert,building_passage|embankment->yes|location->underwater,underground|power->line,minor_line|man_made->pier,breakwater,embankment,groyne,dyke,pipeline|route->ferry|highway->proposed,construction|ice_road->yes|winter_road->yes|snowmobile->yes|ski->yes|ford->!no&ford->*",
"nodes.intersecting.non_offending": "ford->!no&ford->*|leisure->slipway|amenity->ferry_terminal",
"buildings.flag": true,
"challenge": {
"description": "Certain OSM features should not cross waterbodies.",
Expand Down
20 changes: 20 additions & 0 deletions docs/checks/lineCrossingWaterBodyCheck.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# LineCrossingWaterBody Check

This check flags Lines, Edges, and optionally buildings that invalidly intersect inland water features. Validity of intersection is determined by the qualities of the intersecting feature. Flags are grouped by waterbody. A flag contains features for a single waterbody and all of its invalidly intersecting features.

A Line should be flagged if it has any tag combination in the configurable "lineItems.offending" and no tag combination in the configurable "lineItems.non_offending". Additionally, the Line must not be a bridge, should be on the same level as the waterbody, and can't have a tag starting with "addr:" or be part of a boundary relation, and should intersect a valid part of the waterbody.

An Edge should be flagged if it has the appropriate highway tag (specified in "highway.minimum" and "highways.exclude"), is not a bridge, is on the same level as the waterbody, has no tag combination from "lineItems.non_offending", has no tag starting with "addr:", intersects a valid part of the waterbody, and either does not have explicit locations for intersections with the waterbody or any explicit location of intersection is not marked by a node with a tag in "nodes.intersecting.non_offending". If any nodes of the street physically in the waterbody do not have a ford tag that is not ford->no, the street should be flagged as well.

A building should be flagged if the "buildings.flag" is set to true, and the building is not a public_transport->station,aerialway=station, is on the same level as the waterbody, and intersects a valid part of the waterbody.

#### Live Examples

1. Street [id:32845241](https://www.openstreetmap.org/way/32845241) and building [id:753774494](https://www.openstreetmap.org/way/753774494) intersect waterbody feature [id:10886166](https://www.openstreetmap.org/relation/10886166) invalidly. Both the street and waterbody share a location (node) at the point of intersection, but this node is not tagged with something from "nodes.intersecting.non_offending".
2. Street [id:738464515](https://www.openstreetmap.org/way/738464515) intersects waterbody feature [id:248766391](https://www.openstreetmap.org/way/248766391) invalidly. Both features share a location (node) at the point of intersection, but this node is not tagged with something from "nodes.intersecting.non_offending".

#### Code Review

The check starts off by validating certain waterbodies (Atlas Areas or Multipolygon relations) as being waterbody features. Then it collects all valid Edges and Lines (and optionally buildings) that intersect the given waterbody feature invalidly. A single flag is created which includes all intersecting land features for the ocean feature. The check repeats this process for every Area and Multipolygon relation in the supplied atlas.

Please see the source code for LineCrossingWaterBodyCheck here: [LineCrossingWaterBodyCheck](../../src/main/java/org/openstreetmap/atlas/checks/validation/intersections/LineCrossingWaterBodyCheck.java)
Loading

0 comments on commit 50748af

Please sign in to comment.