@Override public void close() throws IOException { try { if (shp != null) { shp.close(); } } finally { try { if (dbf != null) { dbf.close(); } } finally { try { if (fidReader != null) { fidReader.close(); } } finally { shp = null; dbf = null; } } } }
@Override protected int getCountInternal(Query query) throws IOException { if (query.getFilter() == Filter.INCLUDE) { IndexFile file = getDataStore().shpManager.openIndexFile(); if (file != null) { try { return file.getRecordCount(); } finally { file.close(); } } // no Index file so use the number of shapefile records ShapefileReader reader = getDataStore().shpManager.openShapeReader(new GeometryFactory(), false); int count = -1; try { count = reader.getCount(count); } catch (IOException e) { throw e; } finally { reader.close(); } return count; } return -1; }
public void close() throws IOException { try { if( shp!=null ) shp.close(); if (dbf != null) { dbf.close(); } } finally { row = null; record = null; shp = null; dbf = null; goodRecs = null; } }
public void close() throws IOException { try { if (shp != null) { shp.close(); } if (dbf != null) { dbf.close(); } } finally { row = null; record = null; shp = null; dbf = null; } }
public void close() throws IOException { try { if (shp != null) { shp.close(); } if (dbf != null) { dbf.close(); } } finally { row = null; record = null; shp = null; dbf = null; } }
public void close() throws IOException { try { if( shp != null ){ shp.close(); } if (dbf != null) { dbf.close(); } } finally { row = null; record = null; shp = null; dbf = null; } }
public static void main(String[] args) throws Exception { FileChannel channel = new FileInputStream(args[0]).getChannel(); ShapefileReader reader = new ShapefileReader(channel, new Lock()); System.out.println(reader.getHeader()); while (reader.hasNext()) { System.out.println(reader.nextRecord().shape()); } reader.close(); }
public void close() throws IOException { shp.close(); try { if( info.qtree!=null ){ info.qtree.close(goodRecs); info.qtree.close(); } } catch (StoreException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
public void close() throws IOException { shp.close(); try { if (info.qtree != null) { info.qtree.close(goodRecs); info.qtree.close(); } } catch (StoreException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
reader.close();
reader.close();
/** * @see org.geotools.data.AbstractDataStore#getCount(org.geotools.data.Query) */ public int getCount(Query query) throws IOException { if (query.getFilter() == Filter.INCLUDE) { IndexFile file = openIndexFile(); if (file != null) { try { return file.getRecordCount(); } finally { file.close(); } } // no Index file so use the number of shapefile records ShapefileReader reader = openShapeReader(new GeometryFactory()); int count = -1; try { count = reader.getCount(count); } catch (IOException e) { throw e; } finally { reader.close(); } return count; } return super.getCount(query); }
/** * @see org.geotools.data.AbstractDataStore#getCount(org.geotools.data.Query) */ public int getCount(Query query) throws IOException { if (query.getFilter() == Filter.INCLUDE) { IndexFile file = openIndexFile(); if (file != null) { try { return file.getRecordCount(); } finally { file.close(); } } // no Index file so use the number of shapefile records ShapefileReader reader = openShapeReader(new GeometryFactory()); int count = -1; try { count = reader.getCount(count); } catch (IOException e) { throw e; } finally { reader.close(); } return count; } return super.getCount(query); }
try { if (reader != null) { reader.close();
} finally { try { shp.close(); } catch (IOException ioe) {