public class Validator
extends java.lang.Object
Constructor and Description |
---|
Validator() |
Modifier and Type | Method and Description |
---|---|
protected void |
addIfNotNull(java.lang.Object item,
java.util.Collection collection) |
void |
setCheckingBasicTopology(boolean checkingBasicTopology)
Sets whether basic JTS validation should be performed
|
void |
setCheckingGeometriesSimple(boolean checkingGeometriesSimple)
Sets whether to enforce the constraint that Geometries must be simple
|
void |
setCheckingLineStringsSimple(boolean checkingLineStringsSimple)
Deprecated.
As of OpenJUMP 1.6, replaced by
setCheckingGeometriesSimple(boolean) |
void |
setCheckingMinAngle(boolean checkingMinAngle)
Sets whether minimum angle should be checked.
|
void |
setCheckingMinPolygonArea(boolean checkingMinPolygonArea)
Sets whether minimum polygon area should be checked.
|
void |
setCheckingMinSegmentLength(boolean checkingMinSegmentLength)
Sets whether minimum segment length should be checked.
|
void |
setCheckingNoHoles(boolean checkingNoHoles)
Sets whether polygons are not allowed to have holes
|
void |
setCheckingNoRepeatedConsecutivePoints(boolean checkingNoRepeatedConsecutivePoints)
Sets whether consecutive points are not allowed to be the same
|
void |
setCheckingPolygonOrientation(boolean checkingPolygonOrientation)
Sets whether polygon orientation should be checked
|
void |
setDisallowedGeometryClasses(java.util.Collection disallowedGeometryClasses)
Sets the Geometry classes that are not allowed in the dataset that will
be validated.
|
void |
setMinAngle(double minAngle)
Sets the angle below which the minimum-angle check
will raise a validation error.
|
void |
setMinPolygonArea(double minPolygonArea)
Sets the area below which the minimum-polygon-area check will raise a
validation error.
|
void |
setMinSegmentLength(double minSegmentLength)
Sets the segment length below which the minimum-segment-length check
will raise a validation error.
|
java.util.List |
validate(java.util.Collection features,
TaskMonitor monitor)
Checks a collection of features.
|
protected void |
validate(Feature feature,
java.util.List validationErrors)
Checks a feature.
|
protected ValidationError |
validateBasicTopology(Feature feature) |
protected ValidationError |
validateGeometriesSimple(Feature feature) |
protected ValidationError |
validateGeometryClass(Feature feature) |
protected ValidationError |
validateMinAngle(Feature feature) |
protected ValidationError |
validateMinPolygonArea(Feature feature) |
protected ValidationError |
validateMinSegmentLength(Feature feature) |
protected ValidationError |
validateNoHoles(Feature feature) |
protected ValidationError |
validateNoRepeatedConsecutivePoints(Feature feature) |
protected ValidationError |
validatePolygonOrientation(Feature feature) |
public void setCheckingBasicTopology(boolean checkingBasicTopology)
checkingBasicTopology
- whether basic JTS validation should be performedpublic void setCheckingNoRepeatedConsecutivePoints(boolean checkingNoRepeatedConsecutivePoints)
checkingNoRepeatedConsecutivePoints
- whether consecutive points are
not allowed to be the samepublic void setCheckingNoHoles(boolean checkingNoHoles)
checkingNoHoles
- whether polygons are not allowed to have holespublic void setCheckingPolygonOrientation(boolean checkingPolygonOrientation)
checkingPolygonOrientation
- whether to enforce the constraint that
polygon shells should be oriented clockwise and holes should be oriented
counterclockwisepublic void setMinSegmentLength(double minSegmentLength)
minSegmentLength
- the threshold used by the minimum-segment-length
checksetCheckingMinSegmentLength(boolean)
public void setMinAngle(double minAngle)
minAngle
- the threshold used by the minimum-angle check, in degreessetCheckingMinAngle(boolean)
public void setMinPolygonArea(double minPolygonArea)
minPolygonArea
- the threshould used by the minimum-polygon-area checksetCheckingMinPolygonArea(boolean)
public void setCheckingLineStringsSimple(boolean checkingLineStringsSimple)
setCheckingGeometriesSimple(boolean)
checkingLineStringsSimple
- whether to enforce the constraint that
LineStrings must be simplepublic void setCheckingGeometriesSimple(boolean checkingGeometriesSimple)
checkingGeometriesSimple
- whether to enforce the constraint that
Geometries must be simplepublic void setCheckingMinSegmentLength(boolean checkingMinSegmentLength)
checkingMinSegmentLength
- whether to enforce the constraint that
segment length should be no less than the minimumsetMinSegmentLength(double)
public void setCheckingMinAngle(boolean checkingMinAngle)
checkingMinAngle
- whether to enforce the constraint that
angle should be no less than the minimumsetMinAngle(double)
public void setCheckingMinPolygonArea(boolean checkingMinPolygonArea)
checkingMinPolygonArea
- whether to enforce the constraint that
area should be no less than the minimum, for single polygons and polygon
elements of GeometryCollections (including MultiPolygons)setMinPolygonArea(double)
public void setDisallowedGeometryClasses(java.util.Collection disallowedGeometryClasses)
disallowedGeometryClasses
- Geometry classes (Polygon.class, for
example) that are not allowedpublic java.util.List validate(java.util.Collection features, TaskMonitor monitor)
features
- the Feature's to validateprotected void addIfNotNull(java.lang.Object item, java.util.Collection collection)
protected void validate(Feature feature, java.util.List validationErrors)
feature
- the Feature to validatevalidationErrors
- a List of ValidationError's to add to if the feature
is not validprotected ValidationError validateGeometryClass(Feature feature)
protected ValidationError validateBasicTopology(Feature feature)
protected ValidationError validateNoRepeatedConsecutivePoints(Feature feature)
protected ValidationError validateGeometriesSimple(Feature feature)
protected ValidationError validatePolygonOrientation(Feature feature)
protected ValidationError validateNoHoles(Feature feature)
protected ValidationError validateMinSegmentLength(Feature feature)
protected ValidationError validateMinAngle(Feature feature)
protected ValidationError validateMinPolygonArea(Feature feature)