/** * Convenience method for opening a QuadTree index. * * @return A new QuadTree * @throws StoreException */ QuadTree openQuadTree() throws StoreException { File file = new File(treeURL.getPath()); FileSystemIndexStore store = new FileSystemIndexStore(file); try { return store.load(openIndexFile()); } catch (IOException e) { throw new StoreException(e); } }
ByteOrder order = byteToOrder(this.byteOrder); this.writeNode(tree.getRoot(), channel, order); } catch (IOException e) { throw new StoreException(e);
shpIndex.close(); FileSystemIndexStore store = new FileSystemIndexStore(file, order); store.store(tree);
int offset = this.getSubNodeOffset(node); this.writeNode(node.getSubNode(i), channel, order);
/** * Calculates the offset * * @param node * * * @throws StoreException DOCUMENT ME! */ private int getSubNodeOffset(Node node) throws StoreException { int offset = 0; Node tmp = null; for (int i = 0; i < node.getNumSubNodes(); i++) { tmp = node.getSubNode(i); offset += (4 * 8); // Envelope size offset += ((tmp.getNumShapeIds() + 3) * 4); // Entries size + 3 offset += this.getSubNodeOffset(tmp); } return offset; }
ByteOrder order = byteToOrder(header.getByteOrder()); ByteBuffer buf = ByteBuffer.allocate(8); buf.order(order);
FileSystemIndexStore store = new FileSystemIndexStore(file, order); printStats(tree); store.store(tree); } finally { tree.close();
int offset = this.getSubNodeOffset(node); this.writeNode(node.getSubNode(i), channel, order);
/** * Calculates the offset * * @param node * * * @throws StoreException * DOCUMENT ME! */ private int getSubNodeOffset(Node node) throws StoreException { int offset = 0; Node tmp = null; for (int i = 0; i < node.getNumSubNodes(); i++) { tmp = node.getSubNode(i); offset += (4 * 8); // Envelope size offset += ((tmp.getNumShapeIds() + 3) * 4); // Entries size + 3 offset += this.getSubNodeOffset(tmp); } return offset; }
ByteOrder order = byteToOrder(header.getByteOrder()); ByteBuffer buf = ByteBuffer.allocate(8); buf.order(order);
FileSystemIndexStore store = new FileSystemIndexStore(treeFile); try { quadTree = store.load(openIndexFile(shxURL)); } catch (IOException e) { throw new StoreException(e);
FileSystemIndexStore store = new FileSystemIndexStore(file, order); printStats(tree); store.store(tree); } finally { tree.close();
int offset = this.getSubNodeOffset(node); this.writeNode(node.getSubNode(i), channel, order);
ByteOrder order = byteToOrder(this.byteOrder); this.writeNode(tree.getRoot(), channel, order); } catch (IOException e) { throw new StoreException(e);
/** * Calculates the offset * * @param node * * * @throws StoreException * DOCUMENT ME! */ private int getSubNodeOffset(Node node) throws StoreException { int offset = 0; Node tmp = null; for (int i = 0; i < node.getNumSubNodes(); i++) { tmp = node.getSubNode(i); offset += (4 * 8); // Envelope size offset += ((tmp.getNumShapeIds() + 3) * 4); // Entries size + 3 offset += this.getSubNodeOffset(tmp); } return offset; }
ByteOrder order = byteToOrder(header.getByteOrder()); ByteBuffer buf = ByteBuffer.allocate(8); buf.order(order);
/** * Convenience method for opening a QuadTree index. * * @return A new QuadTree * @throws StoreException */ QuadTree openQuadTree() throws StoreException { URL url = shpFiles.acquireRead(QIX, this); try { File file = DataUtilities.urlToFile(url); FileSystemIndexStore store = new FileSystemIndexStore(file); try { return store.load(openIndexFile(), false); } catch (IOException e) { throw new StoreException(e); } } finally { shpFiles.unlockRead(url, this); } }
ByteOrder order = byteToOrder(this.byteOrder); this.writeNode(tree.getRoot(), channel, order); } catch (IOException e) { throw new StoreException(e);
/** * Convenience method for opening a QuadTree index. * * @return A new QuadTree * * @throws StoreException */ protected QuadTree openQuadTree() throws StoreException { if (!isLocal()) { return null; } URL treeURL = shpFiles.acquireRead(QIX, this); try { File treeFile = DataUtilities.urlToFile(treeURL); if (!treeFile.exists() || (treeFile.length() == 0)) { treeType = IndexType.NONE; return null; } try { FileSystemIndexStore store = new FileSystemIndexStore(treeFile); return store.load(openIndexFile(), useMemoryMappedBuffer); } catch (IOException e) { throw new StoreException(e); } } finally { shpFiles.unlockRead(treeURL, this); } }
/** * Convenience method for opening a QuadTree index. * * @return A new QuadTree * * @throws StoreException */ protected QuadTree openQuadTree() throws StoreException { if (!isLocal()) { return null; } URL treeURL = shpFiles.acquireRead(QIX, this); try { File treeFile = DataUtilities.urlToFile(treeURL); if (!treeFile.exists() || (treeFile.length() == 0)) { treeType = IndexType.NONE; return null; } try { FileSystemIndexStore store = new FileSystemIndexStore(treeFile); return store.load(openIndexFile(), useMemoryMappedBuffer); } catch (IOException e) { throw new StoreException(e); } } finally { shpFiles.unlockRead(treeURL, this); } }