* @throws Exception DOCUMENT ME!
*/
public boolean validate(Map layers, ReferencedEnvelope envelope,
final ValidationResults results) throws Exception {
LineStringGraphGenerator lgb = new LineStringGraphGenerator();
SimpleFeatureSource fs = (SimpleFeatureSource) layers.get(typeName);
SimpleFeatureCollection fr = fs.getFeatures();
SimpleFeatureCollection fc = fr;
SimpleFeatureIterator f = fc.features();
while (f.hasNext()) {
SimpleFeature ft = f.next();
if (envelope.contains(ft.getBounds())) {
//lgb.add(ft);
lgb.add(ft.getDefaultGeometry());
}
}
// lgb is loaded
Graph g = lgb.getGraph();
return(g.getNodesOfDegree(0).size() == 0);
}