Package org.openstreetmap.josm.data.osm
Class DatasetConsistencyTest
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.DatasetConsistencyTest
-
public class DatasetConsistencyTest extends java.lang.Object
This class can be used to run consistency tests on dataset. Any errors found will be written to provided PrintWriter.
Texts here should not be translated because they're not intended for users but for josm developers.- Since:
- 2500
-
-
Field Summary
Fields Modifier and Type Field Description private DataSet
dataSet
private int
errorCount
private static int
MAX_ERRORS
private java.io.PrintWriter
writer
-
Constructor Summary
Constructors Constructor Description DatasetConsistencyTest(DataSet dataSet, java.io.Writer writer)
Constructs a newDatasetConsistencyTest
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkCompleteNodesWithoutCoordinates()
Checks for complete nodes without coordinates.void
checkCompleteWaysWithIncompleteNodes()
Checks for complete ways with incomplete nodes.private void
checkReferredPrimitive(OsmPrimitive primitive, OsmPrimitive parent)
void
checkReferrers()
Checks that parent primitive is referred from its child membersvoid
checkZeroNodesWays()
Checks for zero and one-node ways.private void
printElapsedTime(Stopwatch stopwatch)
private void
printError(java.lang.String type, java.lang.String message, java.lang.Object... args)
void
referredPrimitiveNotInDataset()
Checks that referred primitives are present in dataset.void
runTest()
Runs test.static java.lang.String
runTests(DataSet dataSet)
Runs test on the given dataset.void
searchNodes()
Checks that nodes can be retrieved through their coordinates.void
searchWays()
Checks that ways can be retrieved through their bounding box.
-
-
-
Field Detail
-
MAX_ERRORS
private static final int MAX_ERRORS
- See Also:
- Constant Field Values
-
writer
private final java.io.PrintWriter writer
-
errorCount
private int errorCount
-
-
Constructor Detail
-
DatasetConsistencyTest
public DatasetConsistencyTest(DataSet dataSet, java.io.Writer writer)
Constructs a newDatasetConsistencyTest
.- Parameters:
dataSet
- The dataset to testwriter
- The writer used to write results
-
-
Method Detail
-
printError
private void printError(java.lang.String type, java.lang.String message, java.lang.Object... args)
-
checkReferrers
public void checkReferrers()
Checks that parent primitive is referred from its child members
-
checkCompleteWaysWithIncompleteNodes
public void checkCompleteWaysWithIncompleteNodes()
Checks for complete ways with incomplete nodes.
-
checkCompleteNodesWithoutCoordinates
public void checkCompleteNodesWithoutCoordinates()
Checks for complete nodes without coordinates.
-
searchNodes
public void searchNodes()
Checks that nodes can be retrieved through their coordinates.
-
searchWays
public void searchWays()
Checks that ways can be retrieved through their bounding box.
-
checkReferredPrimitive
private void checkReferredPrimitive(OsmPrimitive primitive, OsmPrimitive parent)
-
referredPrimitiveNotInDataset
public void referredPrimitiveNotInDataset()
Checks that referred primitives are present in dataset.
-
checkZeroNodesWays
public void checkZeroNodesWays()
Checks for zero and one-node ways.
-
printElapsedTime
private void printElapsedTime(Stopwatch stopwatch)
-
runTest
public void runTest()
Runs test.
-
-