ShapefileDataStoreFactory shpFactory = new ShapefileDataStoreFactory();
DirectoryDataStore dir = new DirectoryDataStore(mosaic.getFile(),
new ShapefileDataStoreFactory.ShpFileStoreFactory(shpFactory, new HashMap()));
try {
dir.createSchema(typeBuilder.buildFeatureType());
FeatureWriter<SimpleFeatureType, SimpleFeature> w =
dir.getFeatureWriterAppend(mosaic.getName(), Transaction.AUTO_COMMIT);
try {