org.geotools.validation.spatial
Class LineNoSelfIntersectValidation

java.lang.Object
  extended byorg.geotools.validation.DefaultFeatureValidation
      extended byorg.geotools.validation.spatial.LineNoSelfIntersectValidation
All Implemented Interfaces:
FeatureValidation, Validation

public class LineNoSelfIntersectValidation
extends DefaultFeatureValidation

LineNoSelfIntersectFeatureValidation purpose.

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"});
 

Version:
$Id: LineNoSelfIntersectValidation.java 17704 2006-01-23 00:26:16Z desruisseaux $ - bowens: changed intersects to crosses
Author:
bowens, Refractions Research, Inc., $Author: jive $ (last modification)

Field Summary
 
Fields inherited from interface org.geotools.validation.Validation
ALL, PRIORITY_COMPLEX, PRIORITY_INVOLVED, PRIORITY_SIMPLE, PRIORITY_TRIVIAL
 
Constructor Summary
LineNoSelfIntersectValidation()
          LineNoSelfIntersectFeatureValidation 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

LineNoSelfIntersectValidation

public LineNoSelfIntersectValidation()
LineNoSelfIntersectFeatureValidation constructor.

Description

Method Detail

getPriority

public int getPriority()
Override getPriority.

Sets the priority level of this validation. This is set by the programmer and is a measure of the expense of this plugin

Specified by:
getPriority in interface Validation
Overrides:
getPriority in class DefaultFeatureValidation
Returns:
A made up priority for this validation.
See Also:
Validation.getPriority()

validate

public boolean validate(Feature feature,
                        FeatureType type,
                        ValidationResults results)
Override validate.

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.

Specified by:
validate in interface FeatureValidation
Overrides:
validate in class DefaultFeatureValidation
Parameters:
feature - The Feature to be validated.
type - The FeatureTypeInfo of the feature.
results - The storage for error messages.
Returns:
True if the feature does not self intersect.
See Also:
org.geotools.validation.FeatureValidation#validate(org.geotools.feature.Feature, org.geotools.feature.FeatureTypeInfo, org.geotools.validation.ValidationResults)


Copyright © GeoTools. All Rights Reserved.