}
//find the layer that matches the typeRef
for (int j = 0; j < layers.length; j++) {
ILayer thisLayer = layers[j];
//make the typeRef
SimpleFeatureType schema = thisLayer.getSchema();
if(schema == null)
continue;
String dataStoreID = schema.getName().getNamespaceURI();
String thisTypeRef = dataStoreID+":"+schema.getName().getLocalPart(); //$NON-NLS-1$
//if the typeRefs match, add the layer to our set
if (thisTypeRef.equals(typeRef)) {
relevantLayers.add(thisLayer);
break;
}
}
}
//for each relevant layer
for (Iterator k = relevantLayers.iterator(); k.hasNext();) {
ILayer thisLayer = (ILayer) k.next();
//get the SimpleFeatureType
SimpleFeatureType type = thisLayer.getSchema();
//create a FeatureReader (collection.reader)
FeatureSource<SimpleFeatureType, SimpleFeature> source;
source = thisLayer.getResource(FeatureSource.class, monitor);
FeatureCollection<SimpleFeatureType, SimpleFeature> collection = source.getFeatures();
//hmm... pretty pictures or efficiency?