/** * Write the headers for this shapefile including the bounds, shape type, the * number of geometries and the total fileLength (in actual bytes, NOT * 16 bit words). */ public void writeHeaders(Envelope bounds,ShapeType type,int numberOfGeometries,int fileLength) throws IOException { try { handler = type.getShapeHandler(); } catch (ShapefileException se) { throw new RuntimeException("unexpected Exception",se); } if (shapeBuffer == null) allocateBuffers(); ShapefileHeader header = new ShapefileHeader(); header.write(shapeBuffer, type, numberOfGeometries, fileLength/2, bounds.getMinX(),bounds.getMinY(),bounds.getMaxX(),bounds.getMaxY()); header.write(indexBuffer, type, numberOfGeometries, 50 + 4 * numberOfGeometries, bounds.getMinX(),bounds.getMinY(),bounds.getMaxX(),bounds.getMaxY()); offset = 50; this.type = type; cnt = 0; shpChannel.position(0); shxChannel.position(0); drain(); }
/** * Write the headers for this shapefile including the bounds, shape type, * the number of geometries and the total fileLength (in actual bytes, NOT * 16 bit words). */ public void writeHeaders(Envelope bounds, ShapeType type, int numberOfGeometries, int fileLength) throws IOException { try { handler = type.getShapeHandler(gf); } catch (ShapefileException se) { throw new RuntimeException("unexpected Exception", se); } if (shapeBuffer == null) allocateBuffers(); ShapefileHeader header = new ShapefileHeader(); header.write(shapeBuffer, type, numberOfGeometries, fileLength / 2, bounds.getMinX(), bounds.getMinY(), bounds.getMaxX(), bounds .getMaxY()); header.write(indexBuffer, type, numberOfGeometries, 50 + 4 * numberOfGeometries, bounds.getMinX(), bounds.getMinY(), bounds.getMaxX(), bounds.getMaxY()); offset = 50; this.type = type; cnt = 0; shpChannel.position(0); shxChannel.position(0); drain(); }
/** * Write the headers for this shapefile including the bounds, shape type, * the number of geometries and the total fileLength (in actual bytes, NOT * 16 bit words). */ public void writeHeaders(Envelope bounds, ShapeType type, int numberOfGeometries, int fileLength) throws IOException { try { handler = type.getShapeHandler(gf); } catch (ShapefileException se) { throw new RuntimeException("unexpected Exception", se); } if (shapeBuffer == null) allocateBuffers(); ShapefileHeader header = new ShapefileHeader(); header.write(shapeBuffer, type, numberOfGeometries, fileLength / 2, bounds.getMinX(), bounds.getMinY(), bounds.getMaxX(), bounds .getMaxY()); header.write(indexBuffer, type, numberOfGeometries, 50 + 4 * numberOfGeometries, bounds.getMinX(), bounds.getMinY(), bounds.getMaxX(), bounds.getMaxY()); offset = 50; this.type = type; cnt = 0; shpChannel.position(0); shxChannel.position(0); drain(); }