Class LineCoveredByPolygonValidation

  extended byorg.geotools.validation.DefaultIntegrityValidation
      extended byorg.geotools.validation.spatial.LinePolygonAbstractValidation
          extended byorg.geotools.validation.spatial.LineCoveredByPolygonValidation
All Implemented Interfaces:
IntegrityValidation, Validation

public class LineCoveredByPolygonValidation
extends LinePolygonAbstractValidation

Ensure a LineString is contained by Polygon.

This is an integrity test in which we ensure that every LineString in a FeatureType is contained by a Polygon in a second FeatureType. This needs to be done as an Integrity Test to account for both the LineString and Polygon FeatureTypes being changed in the same Transaction. Further more the test will need to be run if either (or both) FeatureTypes are changed: a new line may be created outside of a polygon, or a polygon may be deleted leaving a line uncovered. If we a bit smarter about these relationship we could run this Validation Test only on LineString insert/modify or Polygon modify/delete but life is too short, and there is always another release.

To do this with any sense of efficiency we will need to take an initial run through the Polygon FeatureSource to build an Index of FeatureID by BoundingBox. We can use this to selectively query the Polygon FeatureSource as we work through the LineString content.

TODO: David Zweirs Read This! Talk to Justin or any of the JUMP experts who have experence in implementing JTS indexes. You can use the "layers" Map to store the generated index, or make up an API to do so as part of the ValidationProcessor. At the very least your index will last for the current validation "run" - which is all that can be expected. What really needs to be done is punt the index generation off to the database/DataStore anything else won't scale (don't you love GIS problems).

$Id: 17704 2006-01-23 00:26:16Z desruisseaux $
Jody Garnett, Refractions Research, Inc., $Author: dmzwiers $ (last modification)

Field Summary
Fields inherited from interface org.geotools.validation.Validation
Constructor Summary
          No argument constructor, required by the Java Bean Specification.
Method Summary
 int getPriority()
          The priority level used to schedule this Validation.
 boolean validate(java.util.Map layers, com.vividsolutions.jts.geom.Envelope envelope, ValidationResults results)
          Check that lineTypeRef is convered by polygonTypeRef.
Methods inherited from class org.geotools.validation.spatial.LinePolygonAbstractValidation
getLineTypeRef, getRestrictedPolygonTypeRef, getTypeRefs, setLineTypeRef, setRestrictedPolygonTypeRef
Methods inherited from class org.geotools.validation.DefaultIntegrityValidation
getDescription, getName, setDescription, setName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public LineCoveredByPolygonValidation()
No argument constructor, required by the Java Bean Specification.

Method Detail


public boolean validate(java.util.Map layers,
                        com.vividsolutions.jts.geom.Envelope envelope,
                        ValidationResults results)
                 throws java.lang.Exception
Check that lineTypeRef is convered by polygonTypeRef.

Detailed description...

Specified by:
validate in interface IntegrityValidation
validate in class DefaultIntegrityValidation
layers - Map of FeatureSource by "dataStoreID:typeName"
envelope - The bounding box that encloses the unvalidated data
results - Used to coallate results information
true if all the features pass this test.
java.lang.Exception - DOCUMENT ME!


public int getPriority()
The priority level used to schedule this Validation.

Specified by:
getPriority in interface Validation
getPriority in class DefaultIntegrityValidation
See Also:

Copyright © GeoTools. All Rights Reserved.