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).
author: Jody Garnett, Refractions Research, Inc. author: $Author: dmzwiers $ (last modification) version: $Id: LineCoveredByPolygonValidation.java 22666 2006-11-09 03:50:28Z jgarnett $ |