void disableShxUsage() throws IOException { this.shp.disableShxUsage(); }
/** * Moves the reader to the specified byte offset in the file. Mind that: * * <ul> * <li>it's your responsibility to ensure the offset corresponds to the actual beginning of a * shape struct * <li>once you call this, reading with hasNext/next on sparse shapefiles will be broken (we * don't know anymore at which shape we are) * </ul> * * @param offset * @throws IOException * @throws UnsupportedOperationException */ public void goTo(int offset) throws IOException, UnsupportedOperationException { disableShxUsage(); if (randomAccessEnabled) { positionBufferForOffset(buffer, offset); int oldRecordOffset = record.end; record.end = offset; try { hasNext(false); // don't check for next logical record equality } catch (IOException ioe) { record.end = oldRecordOffset; throw ioe; } } else { throw new UnsupportedOperationException("Random Access not enabled"); } }
/** * Returns the shape at the specified byte distance from the beginning of the file. Mind that: * * <ul> * <li>it's your responsibility to ensure the offset corresponds to the actual beginning of a * shape struct * <li>once you call this, reading with hasNext/next on sparse shapefiles will be broken (we * don't know anymore at which shape we are) * </ul> * * @param offset * @throws IOException * @throws UnsupportedOperationException */ public Object shapeAt(int offset) throws IOException, UnsupportedOperationException { disableShxUsage(); if (randomAccessEnabled) { this.goTo(offset); return nextRecord().shape(); } throw new UnsupportedOperationException("Random Access not enabled"); }
/** * Moves the reader to the specified byte offset in the file. Mind that: * <ul> * <li>it's your responsibility to ensure the offset corresponds to the * actual beginning of a shape struct</li> * <li>once you call this, reading with hasNext/next on sparse shapefiles * will be broken (we don't know anymore at which shape we are)</li> * </ul> * * @param offset * @throws IOException * @throws UnsupportedOperationException */ public void goTo(int offset) throws IOException, UnsupportedOperationException { disableShxUsage(); if (randomAccessEnabled) { positionBufferForOffset(buffer, offset); int oldRecordOffset = record.end; record.end = offset; try { hasNext(false); // don't check for next logical record equality } catch (IOException ioe) { record.end = oldRecordOffset; throw ioe; } } else { throw new UnsupportedOperationException("Random Access not enabled"); } }
disableShxUsage(); if (randomAccessEnabled) { if (this.useMemoryMappedBuffer) {
/** * Returns the shape at the specified byte distance from the beginning of * the file. Mind that: * <ul> * <li>it's your responsibility to ensure the offset corresponds to the * actual beginning of a shape struct</li> * <li>once you call this, reading with hasNext/next on sparse shapefiles * will be broken (we don't know anymore at which shape we are)</li> * </ul> * * * @param offset * @throws IOException * @throws UnsupportedOperationException */ public Object shapeAt(int offset) throws IOException, UnsupportedOperationException { disableShxUsage(); if (randomAccessEnabled) { this.goTo(offset); return nextRecord().shape(); } throw new UnsupportedOperationException("Random Access not enabled"); }
/** * Returns the shape at the specified byte distance from the beginning of * the file. Mind that: * <ul> * <li>it's your responsibility to ensure the offset corresponds to the * actual beginning of a shape struct</li> * <li>once you call this, reading with hasNext/next on sparse shapefiles * will be broken (we don't know anymore at which shape we are)</li> * </ul> * * * @param offset * @throws IOException * @throws UnsupportedOperationException */ public Object shapeAt(int offset) throws IOException, UnsupportedOperationException { disableShxUsage(); if (randomAccessEnabled) { this.goTo(offset); return nextRecord().shape(); } throw new UnsupportedOperationException("Random Access not enabled"); }
attReader.shp.disableShxUsage(); if(attReader.hasNext()) { shapeType = attReader.shp.getHeader().getShapeType();
attReader.shp.disableShxUsage(); if(attReader.hasNext()) { shapeType = attReader.shp.getHeader().getShapeType();