File tmp = File.createTempFile(layers[0].getName() + "_" + layers[1].getName() + "_diff", ".shp"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
DataStore ds = dsfac.createDataStore(tmp.toURL());
final SimpleFeatureType newSchema = FeatureTypes.newFeatureType(
fromLayer.getSchema().getAttributeDescriptors().toArray(
new AttributeDescriptor[0]), "diff"); //$NON-NLS-1$
ds.createSchema(newSchema);
final FeatureSource<SimpleFeatureType, SimpleFeature> fromSource = fromLayer.getResource(FeatureSource.class, monitor);
final FeatureSource<SimpleFeatureType, SimpleFeature> diffSource = diffLayer.getResource(FeatureSource.class, monitor);
if (isGeometryCollection(fromSource.getSchema().getGeometryDescriptor())) {
MessageDialog.openError(display.getActiveShell(), Messages.differenceOp_inputError, fromLayer.getName() + Messages.differenceOp_multiGeoms);