@Override
protected void write(FeatureCollectionResponse featureCollection, OutputStream output,
Operation getFeature) throws IOException, ServiceException {
SpatiaLiteDataStoreFactory dsFactory = new SpatiaLiteDataStoreFactory();
if (!dsFactory.isAvailable()) {
throw new ServiceException("SpatiaLite support not avaialable, ensure all required " +
"native libraries are installed");
}
/**
* base location to temporally store spatialite database `es
*/
File dbFile = File.createTempFile("spatialite", ".db");
Map dbParams = new HashMap();
dbParams.put(SpatiaLiteDataStoreFactory.DBTYPE.key, "spatialite");
dbParams.put(SpatiaLiteDataStoreFactory.DATABASE.key, dbFile.getAbsolutePath());
DataStore dataStore = dsFactory.createDataStore(dbParams);
try {
for (FeatureCollection fc : featureCollection.getFeatures()) {
SimpleFeatureType featureType = (SimpleFeatureType) fc.getSchema()
;