Class Validator
java.lang.Object
com.vividsolutions.jump.qa.Validator
Performs basic JTS validation, and additional validation like checking polygon
orientation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddIfNotNull(Object item, Collection<Object> collection) voidsetCheckingBasicTopology(boolean checkingBasicTopology) Sets whether basic JTS validation should be performedvoidsetCheckingGeometriesSimple(boolean checkingGeometriesSimple) Sets whether to enforce the constraint that Geometries must be simplevoidsetCheckingMinAngle(boolean checkingMinAngle) Sets whether minimum angle should be checked.voidsetCheckingMinPolygonArea(boolean checkingMinPolygonArea) Sets whether minimum polygon area should be checked.voidsetCheckingMinSegmentLength(boolean checkingMinSegmentLength) Sets whether minimum segment length should be checked.voidsetCheckingNoHoles(boolean checkingNoHoles) Sets whether polygons are not allowed to have holesvoidsetCheckingNoRepeatedConsecutivePoints(boolean checkingNoRepeatedConsecutivePoints) Sets whether consecutive points are not allowed to be the samevoidsetCheckingPolygonOrientation(boolean checkingPolygonOrientation) Sets whether polygon orientation should be checkedvoidsetDisallowedGeometryClasses(Collection<Class> disallowedGeometryClasses) Sets the Geometry classes that are not allowed in the dataset that will be validated.voidsetMinAngle(double minAngle) Sets the angle below which the minimum-angle check will raise a validation error.voidsetMinPolygonArea(double minPolygonArea) Sets the area below which the minimum-polygon-area check will raise a validation error.voidsetMinSegmentLength(double minSegmentLength) Sets the segment length below which the minimum-segment-length check will raise a validation error.protected voidChecks a feature.validate(Collection features, TaskMonitor monitor) Checks a collection of features.protected ValidationErrorvalidateBasicTopology(Feature feature) protected ValidationErrorvalidateGeometriesSimple(Feature feature) protected ValidationErrorvalidateGeometryClass(Feature feature) protected ValidationErrorvalidateMinAngle(Feature feature) protected ValidationErrorvalidateMinPolygonArea(Feature feature) protected ValidationErrorvalidateMinSegmentLength(Feature feature) protected ValidationErrorvalidateNoHoles(Feature feature) protected ValidationErrorprotected ValidationErrorvalidatePolygonOrientation(Feature feature)
-
Constructor Details
-
Validator
public Validator()
-
-
Method Details
-
setCheckingBasicTopology
public void setCheckingBasicTopology(boolean checkingBasicTopology) Sets whether basic JTS validation should be performed- Parameters:
checkingBasicTopology- whether basic JTS validation should be performed
-
setCheckingNoRepeatedConsecutivePoints
public void setCheckingNoRepeatedConsecutivePoints(boolean checkingNoRepeatedConsecutivePoints) Sets whether consecutive points are not allowed to be the same- Parameters:
checkingNoRepeatedConsecutivePoints- whether consecutive points are not allowed to be the same
-
setCheckingNoHoles
public void setCheckingNoHoles(boolean checkingNoHoles) Sets whether polygons are not allowed to have holes- Parameters:
checkingNoHoles- whether polygons are not allowed to have holes
-
setCheckingPolygonOrientation
public void setCheckingPolygonOrientation(boolean checkingPolygonOrientation) Sets whether polygon orientation should be checked- Parameters:
checkingPolygonOrientation- whether to enforce the constraint that polygon shells should be oriented clockwise and holes should be oriented counterclockwise
-
setMinSegmentLength
public void setMinSegmentLength(double minSegmentLength) Sets the segment length below which the minimum-segment-length check will raise a validation error.- Parameters:
minSegmentLength- the threshold used by the minimum-segment-length check- See Also:
-
setMinAngle
public void setMinAngle(double minAngle) Sets the angle below which the minimum-angle check will raise a validation error.- Parameters:
minAngle- the threshold used by the minimum-angle check, in degrees- See Also:
-
setMinPolygonArea
public void setMinPolygonArea(double minPolygonArea) Sets the area below which the minimum-polygon-area check will raise a validation error.- Parameters:
minPolygonArea- the threshould used by the minimum-polygon-area check- See Also:
-
setCheckingGeometriesSimple
public void setCheckingGeometriesSimple(boolean checkingGeometriesSimple) Sets whether to enforce the constraint that Geometries must be simple- Parameters:
checkingGeometriesSimple- whether to enforce the constraint that Geometries must be simple- Since:
- OpenJUMP 1.6
-
setCheckingMinSegmentLength
public void setCheckingMinSegmentLength(boolean checkingMinSegmentLength) Sets whether minimum segment length should be checked.- Parameters:
checkingMinSegmentLength- whether to enforce the constraint that segment length should be no less than the minimum- See Also:
-
setCheckingMinAngle
public void setCheckingMinAngle(boolean checkingMinAngle) Sets whether minimum angle should be checked.- Parameters:
checkingMinAngle- whether to enforce the constraint that angle should be no less than the minimum- See Also:
-
setCheckingMinPolygonArea
public void setCheckingMinPolygonArea(boolean checkingMinPolygonArea) Sets whether minimum polygon area should be checked.- Parameters:
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)- See Also:
-
setDisallowedGeometryClasses
Sets the Geometry classes that are not allowed in the dataset that will be validated.- Parameters:
disallowedGeometryClasses- Geometry classes (Polygon.class, for example) that are not allowed
-
validate
Checks a collection of features.- Parameters:
features- the Feature's to validate- Returns:
- a List of ValidationErrors; if all features are valid, the list will be empty
-
addIfNotNull
-
validate
-
validateGeometryClass
-
validateBasicTopology
-
validateNoRepeatedConsecutivePoints
-
validateGeometriesSimple
-
validatePolygonOrientation
-
validateNoHoles
-
validateMinSegmentLength
-
validateMinAngle
-
validateMinPolygonArea
-