forked from osmlab/atlas-checks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request osmlab#164 from maps-osm/dev_merge_602
Bringing in atlas checks 6.0.1 and 6.0.2
- Loading branch information
Showing
82 changed files
with
3,927 additions
and
989 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# AtGradeSignPostCheck | ||
|
||
#### Description | ||
|
||
This check identifies at-grade intersections that are not modeled into destination_sign relations. | ||
An at-grade intersection is an intersection with two or more edges at the same level with valid | ||
highway classifications. The highway classifications of the in and out edges of an at-grade intersection are specified in the configuration file and are as follows: | ||
1. If in edge is of type primary, the intersection is valid if there are at least two out edges, at the same z level as the in edge, that are either trunk, primary or secondary. | ||
2. If in edge is of type trunk or secondary, the intersection is valid if there are at least two out edges, at the same z level as the in edge, that are primary. | ||
|
||
#### Live Examples | ||
|
||
1. Node [id:393673917](https://www.openstreetmap.org/node/393673917) forms an at-grade intersection | ||
with ways [393673917](https://www.openstreetmap.org/way/202447272), | ||
[34370252](https://www.openstreetmap.org/way/34370252) and | ||
[41234996](https://www.openstreetmap.org/way/41234996) but is not a member of a "destination_sign" relation. | ||
2. Node [id:5351792253](https://www.openstreetmap.org/node/5351792253) forms an at-grade intersection with its exit road | ||
[554569602](https://www.openstreetmap.org/way/554569602) but is not a member of a "destination_sign" relation. | ||
|
||
#### Code Review | ||
|
||
The check ensures that the Atlas object being evaluated is a [Node](https://github.com/osmlab/atlas/blob/dev/src/main/java/org/openstreetmap/atlas/geography/atlas/items/Node.java) | ||
with a minimum node valence of 3. The node is a valid candidate for the check if it forms an intersection with edges at the same z-level with highway classification specified in the configurable. | ||
Once the node is evaluated to be a valid at-grade intersection, check if it is a member of any destination_sign relations. | ||
If the node is not part of a destination_sign relation, then flag the node along with the intersecting edges. Since a node can be part of multiple destination_sign | ||
relations, check if all the valid intersecting edges are members of destination_sign relations. If there are edges missing destination_sign | ||
relations, flag the node and the edges. If all the intersecting edges are members of relations, check if all the relations have destination tags. | ||
If the relations are missing destination_sign tag, flag it. If the node is part of a roundabout, flag all the roundabout edges when flagging the node and its intersecting edges. | ||
|
||
To learn more about the code, please look at the comments in the source code for the check. | ||
[AtGradeSignPostCheck.java](../../src/main/java/org/openstreetmap/atlas/checks/validation/intersections/AtGradeSignPostCheck.java) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Ocean Bleeding Check | ||
|
||
This check aims to flag streets, railways, and buildings that bleed into (intersect) ocean features. Intersection includes any geometrical interaction between the ocean feature and the land feature. The definition of streets and railways can be changed in the configuration for the check ("lineItems.offending" for railways, "highway.minimum" and "highway.exclude" for streets) Additionally, tags that should be considered when validating/invalidating an ocean feature are configurable. | ||
|
||
#### Live Examples | ||
|
||
1. Building [id:355294262](https://www.openstreetmap.org/way/355294262#map=19/22.36138/114.09546&layers=C) extends into ocean feature [id:243872591](https://www.openstreetmap.org/way/243872591#map=16/22.3630/114.0932&layers=C) invalidly. | ||
2. Street [id:327223335](https://www.openstreetmap.org/way/327223335#map=17/25.21095/55.24491&layers=C) extends into ocean feature [id:87287185](https://www.openstreetmap.org/way/87287185#map=17/25.21143/55.24443&layers=C) invalidly. | ||
|
||
#### Code Review | ||
|
||
The check starts off by validating certain waterbodies (Atlas Areas or LineItems) as being ocean features. Then it collects all valid buildings, streets, and railways that intersect the given ocean feature. A single flag is created which includes all intersecting land features for the ocean feature. The check repeats this process for every Area and LineItem in the supplied atlas. | ||
|
||
Please see source code for OceanBleedingCheck here: [OceanBleedingCheck](../../src/main/java/org/openstreetmap/atlas/checks/validation/intersections/OceanBleedingCheck.java) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Sharded Atlas Checks | ||
|
||
Sharded Atlas Checks is an implementation of the Atlas Checks framework that seeks to provide a memory efficient way to run large data sets. This is achieved using a "sharded" input schema and parallel processing. | ||
|
||
Normally when running Atlas Checks the size of input data is capped on a per country level by the amount of memory available. This means that even in a distributed environment enormous amounts of RAM are required to run countries like USA, RUS, and CHN. This implementation circumvents that cap by processing a country as multiple small sections. Each section is loaded as an individual process. Each process runs checks on the given section and returns a set of flags. Flags from all sections of a country are combined in the output. | ||
|
||
While the normal Atlas Checks job can run on either PBF or Atlas files, this job is restricted to specialized atlas files. These files should be in a countrified and sharded format. These files can be produced by using [Atlas Generator](https://github.com/osmlab/atlas-generator). | ||
|
||
## How To Run | ||
|
||
Sharded Checks is designed to be run in a Spark [cluster](cluster.md) for best performance, but can also be run as a standalone Java execution. The following details the parameters required for running the job in either environment, and parameters that are unique to Sharded Checks. | ||
|
||
#### Main Class | ||
The main class of this job is org.openstreetmap.atlas.checks.distributed.ShardedIntegrityChecksSparkJob. | ||
|
||
#### Input Data Path | ||
Input Atlas files should be organized by country and sub-region (shard). The root of the input folder should contain sub-folders that are named by ISO3 county codes. Each sub-folder should contain atlas files named with the schema `<iso>_<zoom>_<x>_<y>.atlas`. An example of the full structure would be: | ||
```text | ||
- root | ||
| - USA | ||
| - SGP | ||
| - SGP_10-806-508.atlas | ||
| - SGP_11-1614-1016.atlas | ||
| - ... | ||
``` | ||
|
||
#### Expansion Distance | ||
To maintain geographic completeness and avoid edge effects while running subsections of countries, each process is allowed to expand the area of a country that is loaded up to a set amount. The distance given in this parameter defines that expansion as shards within the given distance (in kilometers). | ||
|
||
#### Sharding Schema | ||
In order to load geographically connected shards together the job requires a definition of the sharding schema used for the input Atlas files. This can be supplied in 2 ways. A dynamic sharding definition can be supplied by placing a sharding.txt file in the input path. Alternatively, a schema can be provided using the `sharding` parameter. For more on this see the [sharding package](https://github.com/osmlab/atlas/tree/dev/src/main/java/org/openstreetmap/atlas/geography/sharding) in Atlas. | ||
|
||
#### In Memory Atlas Type | ||
By default Sharded Checks uses a [Dynamic Atlas](https://github.com/osmlab/atlas/tree/dev/src/main/java/org/openstreetmap/atlas/geography/atlas/dynamic). It is also possible to use a [Multi Atlas](https://github.com/osmlab/atlas/tree/dev/src/main/java/org/openstreetmap/atlas/geography/atlas/multi) to load Atlas files. This can be done by setting the `multiAtlas` parameter to `true`. It has been found that a Multi Atlas is the more performant in non-distributed environments. | ||
|
||
#### Spark Storage | ||
By default Spark uses memory before disk when storing an RDD. In environments with large mounts of available memory this works well. In memory limited environments this can bog down when trying to process large data sets. In these scenarios it is more efficient to save everything directly to disk. This can be done by setting the `sparkStorageDiskOnly` to `true`. | ||
|
||
#### Shared Arguments | ||
The following are brief descriptions of the parameters that Sharded Atlas Checks shares with the normal job | ||
|
||
| Parameter | Description | | ||
|---|---| | ||
| Output Path | Local or remote folder to save outputs to | | ||
| Output Formats | Comma separated list of output types (flags,geojson,metrics,tippecanoe); MapRoulette output is not available in Sharded Checks | | ||
| Countries | Comma separated list of ISO3 country codes of countries to run | | ||
| Configuration File | Comma separated list of resource URIs for checks configuration json files | | ||
| Master | Spark cluster master URL (just `local` for local environments) | | ||
|
||
## Limitations | ||
|
||
#### Limited Input | ||
Currently Sharded Checks only supports sharded Atlas files as an input data source. Eventually this may be expanded to include PBF files. | ||
|
||
#### Large Relations | ||
There is a known issue with large relations being flagged incorrectly. This can occur when a relation spans many shards and even at maximum expansion it cannot all be loaded. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.