|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.validation.DefaultFeatureValidation org.geotools.validation.spatial.LineMustBeASinglePartValidation
LineIsSingleSegmentFeatureValidation purpose.
Tests to see if a LineString is made of only one segment, meaning it only has two points. If the LineString has more than two points, the test fails.
This method has been extended to work with MultiLineStrings - this is the most common format that shapefile appears in and as such is forcing our hand.
Example Use:
LineIsSingleSegmentFeatureValidation x = new LineIsSingleSegmentFeatureValidation("noSelfIntersectRoads", "Tests to see if a
geometry intersects itself", new String[] {"road"});
Field Summary |
Fields inherited from interface org.geotools.validation.Validation |
ALL, PRIORITY_COMPLEX, PRIORITY_INVOLVED, PRIORITY_SIMPLE, PRIORITY_TRIVIAL |
Constructor Summary | |
LineMustBeASinglePartValidation()
LineIsSingleSegmentFeatureValidation constructor. |
Method Summary | |
int |
getPriority()
Override getPriority. |
boolean |
validate(Feature feature,
FeatureType type,
ValidationResults results)
Override validate. |
Methods inherited from class org.geotools.validation.DefaultFeatureValidation |
getDefaultLineString, getDescription, getName, getTypeRef, getTypeRefs, setDescription, setName, setTypeRef |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LineMustBeASinglePartValidation()
Description
Method Detail |
public int getPriority()
Sets the priority level of this validation.
getPriority
in interface Validation
getPriority
in class DefaultFeatureValidation
PRIORITY_SIMPLE
Validation.getPriority()
public boolean validate(Feature feature, FeatureType type, ValidationResults results)
Tests to see if a LineString is made of only one segment, meaning it only has two points. If the LineString has more than two points, the test fails.
validate
in interface FeatureValidation
validate
in class DefaultFeatureValidation
feature
- The Feature to be validatedtype
- The FeatureTypeInfo of the featureresults
- The storage for error messages.
org.geotools.validation.FeatureValidation#validate(org.geotools.feature.Feature,
org.geotools.feature.FeatureTypeInfo,
org.geotools.validation.ValidationResults)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |