org.geotools.validation.spatial
Class LineNoSelfOverlappingValidation

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

public class LineNoSelfOverlappingValidation
extends DefaultFeatureValidation

Ensure the defaultGeometry does not overlap (only works for LineString).

Tests to see if a LineString overlaps itself. It does this by breaking up the LineString into two point segments then intersects them all. If a segment has both of its points on another segment, then they overlap. This is not true in all cases and this method has to be rewritten. If a segment spans two segments, this method will say that they do not overlap when clearly they do.

Version:
$Id: LineNoSelfOverlappingValidation.java 17704 2006-01-23 00:26:16Z desruisseaux $
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
LineNoSelfOverlappingValidation()
          LineNoSelfOverlappingFeatureValidation constructor.
 
Method Summary
 int getPriority()
          Override getPriority.
 boolean validate(Feature feature, FeatureType type, ValidationResults results)
          Tests to see if a LineString overlaps itself.
 
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

LineNoSelfOverlappingValidation

public LineNoSelfOverlappingValidation()
LineNoSelfOverlappingFeatureValidation constructor.

Description

Method Detail

getPriority

public int getPriority()
Override getPriority.

Sets the priority level of this validation.

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)
Tests to see if a LineString overlaps itself.

It does this by breaking up the LineString into two point segments then intersects them all. If a segment has both of its points on another segment, then they overlap. This is not true in all cases and this method has to be rewritten. If a segment spans two segments, this method will say that they do not overlap when clearly they do.

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 overlap itself.
See Also:
org.geotools.validation.FeatureValidation#validate(org.geotools.feature.Feature, org.geotools.feature.FeatureTypeInfo, org.geotools.validation.ValidationResults)


Copyright © GeoTools. All Rights Reserved.