|
Last change
on this file since 9855 was 8378, checked in by Don-vip, 11 years ago |
|
fix copyright/license headers globally
|
-
Property svn:eol-style
set to
native
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | // License: GPL. For details, see LICENSE file.
|
|---|
| 2 | package org.openstreetmap.josm.data.validation.tests;
|
|---|
| 3 |
|
|---|
| 4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
|---|
| 5 |
|
|---|
| 6 | import org.openstreetmap.josm.data.osm.Node;
|
|---|
| 7 | import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
|---|
| 8 | import org.openstreetmap.josm.data.validation.Severity;
|
|---|
| 9 | import org.openstreetmap.josm.data.validation.Test;
|
|---|
| 10 | import org.openstreetmap.josm.data.validation.TestError;
|
|---|
| 11 |
|
|---|
| 12 | /**
|
|---|
| 13 | * Performs validation tests on barriers and entrances.
|
|---|
| 14 | * @since 6192
|
|---|
| 15 | */
|
|---|
| 16 | public class BarriersEntrances extends Test {
|
|---|
| 17 |
|
|---|
| 18 | protected static final int BARRIER_ENTRANCE_WITHOUT_BARRIER = 2801;
|
|---|
| 19 |
|
|---|
| 20 | /**
|
|---|
| 21 | * Constructor
|
|---|
| 22 | */
|
|---|
| 23 | public BarriersEntrances() {
|
|---|
| 24 | super(tr("Barriers and entrances"), tr("Checks for errors in barriers and entrances."));
|
|---|
| 25 | }
|
|---|
| 26 |
|
|---|
| 27 | @Override
|
|---|
| 28 | public void visit(Node n) {
|
|---|
| 29 | if (n.hasTag("barrier", "entrance") && !n.isOutsideDownloadArea()) {
|
|---|
| 30 | for (OsmPrimitive p : n.getReferrers()) {
|
|---|
| 31 | if (p.hasKey("barrier")) {
|
|---|
| 32 | return;
|
|---|
| 33 | }
|
|---|
| 34 | }
|
|---|
| 35 | errors.add(new TestError(this, Severity.WARNING, tr("Barrier entrance not set on a barrier"), BARRIER_ENTRANCE_WITHOUT_BARRIER, n));
|
|---|
| 36 | }
|
|---|
| 37 | }
|
|---|
| 38 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.