@Override public SimpleFeature next() throws IOException { // closed already, error! if (featureReader == null) { throw new IOException("Writer closed"); } // we have to write the current feature back into the stream if (currentFeature != null) { write(); } long next = fidWriter.next(); currentFid = getFeatureType().getTypeName() + "." + next; SimpleFeature feature = super.next(); return feature; }
/** * Release resources and flush the header information. */ public void close() throws IOException { super.close(); fidWriter.close(); try { if (shpFiles.isLocal()) { if (indexedShapefileDataStore.needsGeneration(ShpFileType.FIX)) { FidIndexer.generate(shpFiles); } deleteFile(ShpFileType.QIX); if (indexedShapefileDataStore.treeType == IndexType.QIX) { indexedShapefileDataStore.buildQuadTree(); } } } catch (Throwable e) { indexedShapefileDataStore.treeType = IndexType.NONE; ShapefileDataStoreFactory.LOGGER.log(Level.WARNING, "Error creating Spatial index", e); } }
return new IndexedShapefileFeatureWriter(typeName, shpFiles, attReader, featureReader, this, dbfCharset, dbfTimeZone);
/** * Release resources and flush the header information. */ public void close() throws IOException { super.close(); fidWriter.close(); try { if (shpFiles.isLocal()) { if (indexedShapefileDataStore.needsGeneration(ShpFileType.FIX)) { FidIndexer.generate(shpFiles); } deleteFile(ShpFileType.QIX); if (indexedShapefileDataStore.treeType == IndexType.QIX) { indexedShapefileDataStore.buildQuadTree(); } } } catch (Throwable e) { indexedShapefileDataStore.treeType = IndexType.NONE; ShapefileDataStoreFactory.LOGGER.log(Level.WARNING, "Error creating Spatial index", e); } }
return new IndexedShapefileFeatureWriter(typeName, shpFiles, attReader, featureReader, this, dbfCharset, dbfTimeZone);
@Override public SimpleFeature next() throws IOException { // closed already, error! if (featureReader == null) { throw new IOException("Writer closed"); } // we have to write the current feature back into the stream if (currentFeature != null) { write(); } long next = fidWriter.next(); currentFid = getFeatureType().getTypeName() + "." + next; SimpleFeature feature = super.next(); return feature; }