public class LineNoSelfIntersectValidation extends DefaultFeatureValidation
Tests to see if a geometry crosses itself. It does not detect if a segment of a LineString doubles back on itself for one segment, then terminates. A different validation is needed to test overlapping. Uses JTS' crosses routine.
Example Use:
LineNoSelfIntersectFeatureValidation x = new LineNoSelfIntersectFeatureValidation("noSelfIntersectRoads", "Tests to see if a
geometry intersects itself", new String[] {"road"});
ALL, PRIORITY_COMPLEX, PRIORITY_INVOLVED, PRIORITY_SIMPLE, PRIORITY_TRIVIAL| Constructor and Description |
|---|
LineNoSelfIntersectValidation()
LineNoSelfIntersectFeatureValidation constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getPriority()
Override getPriority.
|
boolean |
validate(SimpleFeature feature,
SimpleFeatureType type,
ValidationResults results)
Override validate.
|
getDefaultLineString, getDescription, getName, getTypeRef, getTypeRefs, setDescription, setName, setTypeRefpublic LineNoSelfIntersectValidation()
Description
public int getPriority()
Sets the priority level of this validation. This is set by the programmer and is a measure of the expense of this plugin
getPriority in interface ValidationgetPriority in class DefaultFeatureValidationValidation.getPriority()public boolean validate(SimpleFeature feature, SimpleFeatureType type, ValidationResults results)
Tests to see if a geometry intersects itself. It does not detect if a segment of a LineString doubles back on itself for one segment, then terminates. A different validation is needed to test overlapping. Uses JTS' intersect routine.
validate in interface FeatureValidationvalidate in class DefaultFeatureValidationfeature - The Feature to be validated.type - The FeatureTypeInfo of the feature.results - The storage for error messages.org.geotools.validation.FeatureValidation#validate(org.geotools.feature.Feature,
org.geotools.feature.FeatureTypeInfo, org.geotools.validation.ValidationResults)Copyright © 1996–2019 Geotools. All rights reserved.