private void init( ShpFiles shpFiles, StorageFile storageFile ) throws IOException { if (!shpFiles.isLocal()) { throw new IllegalArgumentException( "Currently only local files are supported for writing"); } try { reader = new IndexedFidReader(shpFiles); } catch (FileNotFoundException e) { reader = new IndexedFidReader(shpFiles, storageFile.getWriteChannel()); } this.channel = storageFile.getWriteChannel(); streamLogger.open(); allocateBuffers(); removes = reader.getRemoves(); writeBuffer.position(HEADER_SIZE); closed = false; position = 0; current = -1; recordIndex = 0; fidIndex = 0; }
private void init( ShpFiles shpFiles, StorageFile storageFile ) throws IOException { if (!shpFiles.isLocal()) { throw new IllegalArgumentException( "Currently only local files are supported for writing"); } try { reader = new IndexedFidReader(shpFiles); } catch (FileNotFoundException e) { reader = new IndexedFidReader(shpFiles, storageFile.getWriteChannel()); } this.channel = storageFile.getWriteChannel(); streamLogger.open(); allocateBuffers(); removes = reader.getRemoves(); writeBuffer.position(HEADER_SIZE); closed = false; position = 0; current = -1; recordIndex = 0; fidIndex = 0; }
new IndexedFidReader(filename.substring(indexslash), writeChannel));
public static FIDReader getFidReader( ShapefileDataStore datastore, RecordNumberTracker tracker ) throws MalformedURLException { if (datastore instanceof IndexedShapefileDataStore) { IndexedShapefileDataStore ids = (IndexedShapefileDataStore)datastore; if( !ids.indexUseable(ShpFileType.FIX) ) return createBasicFidReader(datastore, tracker); try{ return new IndexedFidReader(ids.shpFiles, tracker); }catch (Exception e) { return createBasicFidReader(datastore,tracker); } } else { return createBasicFidReader(datastore, tracker); } }
IndexedFidReader reader = new IndexedFidReader(shpFiles);
IndexedFidReader reader = new IndexedFidReader(shpFiles);
protected FeatureReader<SimpleFeatureType, SimpleFeature> createFeatureReader(String typeName, IndexedShapefileAttributeReader r, SimpleFeatureType readerSchema) throws SchemaException, IOException { if(r == null) { return new EmptyFeatureReader<SimpleFeatureType, SimpleFeature>(readerSchema); } FIDReader fidReader; if (!indexUseable(FIX)) { fidReader = new ShapeFIDReader(getCurrentTypeName(), r); } else { fidReader = new IndexedFidReader(shpFiles, r); } return new org.geotools.data.FIDFeatureReader(r, fidReader, readerSchema); }
protected FeatureReader<SimpleFeatureType, SimpleFeature> createFeatureReader(String typeName, IndexedShapefileAttributeReader r, SimpleFeatureType readerSchema) throws SchemaException, IOException { if(r == null) { return new EmptyFeatureReader<SimpleFeatureType, SimpleFeature>(readerSchema); } FIDReader fidReader; if (!indexUseable(FIX)) { fidReader = new ShapeFIDReader(getCurrentTypeName(), r); } else { fidReader = new IndexedFidReader(shpFiles, r); } return new org.geotools.data.FIDFeatureReader(r, fidReader, readerSchema); }
public static FIDReader getFidReader( ShapefileDataStore datastore, RecordNumberTracker tracker ) throws MalformedURLException { if (datastore instanceof IndexedShapefileDataStore) { IndexedShapefileDataStore ids = (IndexedShapefileDataStore)datastore; if( ids.fixURL==null ) return createBasicFidReader(datastore, tracker); try{ return new IndexedFidReader(datastore.getCurrentTypeName(), tracker, datastore.getReadChannel(ids.fixURL)); }catch (Exception e) { return createBasicFidReader(datastore,tracker); } } else { return createBasicFidReader(datastore, tracker); } }
/** * DOCUMENT ME! * * @param typeName * @param r * @param readerSchema * * * @throws SchemaException * @throws IOException */ protected FeatureReader createFeatureReader(String typeName, Reader r, FeatureType readerSchema) throws SchemaException, IOException { if (isLocal() && fixURL!=null ) { if (!(new File(fixURL.getFile()).exists())) fixURL=FidIndexer.generate(shpURL); if( fixURL==null ) return new org.geotools.data.FIDFeatureReader(r, new ShapeFIDReader(getCurrentTypeName(), r), readerSchema); return new org.geotools.data.FIDFeatureReader(r, new IndexedFidReader(getCurrentTypeName(), r, getReadChannel(fixURL)), readerSchema); } else { return new org.geotools.data.FIDFeatureReader(r, new ShapeFIDReader(getCurrentTypeName(), r), readerSchema); } }
reader = new IndexedFidReader(getCurrentTypeName(), getReadChannel(fixURL)); if (reader.getRemoves() >= reader.getCount() / 2) {
new IndexedFidReader(getCurrentTypeName(), temp!=0?getReadChannel(fixURL):fidIndexChannel));