Class ShapeFileIndexWriter

    • Constructor Detail

      • ShapeFileIndexWriter

        public ShapeFileIndexWriter​(File shapeName,
                                    ShapeElementType elementType,
                                    ESRIBounds bounds)
                             throws IOException
        Constructor.
        Parameters:
        shapeName - is the file to write
        elementType - is the type of the elements to write.
        bounds - are the bounds to put in the header.
        Throws:
        IOException - in case of error.
      • ShapeFileIndexWriter

        public ShapeFileIndexWriter​(URL shapeName,
                                    ShapeElementType elementType,
                                    ESRIBounds bounds)
                             throws IOException
        Constructor.
        Parameters:
        shapeName - is the file to write
        elementType - is the type of the elements to write.
        bounds - are the bounds to put in the header.
        Throws:
        IOException - in case of error.
      • ShapeFileIndexWriter

        public ShapeFileIndexWriter​(OutputStream stream,
                                    ShapeElementType elementType,
                                    ESRIBounds bounds)
                             throws IOException
        Constructor.
        Parameters:
        stream - is the file to write
        elementType - is the type of the elements to write.
        bounds - are the bounds to put in the header.
        Throws:
        IOException - in case of error.
      • ShapeFileIndexWriter

        public ShapeFileIndexWriter​(WritableByteChannel channel,
                                    ShapeElementType elementType,
                                    ESRIBounds bounds)
                             throws IOException
        Constructor.
        Parameters:
        channel - is the file to write
        elementType - is the type of the elements to write.
        bounds - are the bounds to put in the header.
        Throws:
        IOException - in case of error.
    • Method Detail

      • write

        public final void write​(int recordLength)
                         throws IOException
        Write a record with the given length at the following offset in the SHX file.

        The length if the count of bytes inside the record (including record header and record content). Assuming record header with length of 8 bytes and record content with length of l bytes, the total record length is l+8 bytes.

        Because the ESRI standard stores this value as a count of 16-bit words (not a count of bytes), it means that the given length may be a multiple of 2. If this record is created with a length which is not a multiple of 2, this object will assumed the upper multiple as length.

        Parameters:
        recordLength - is the length to write inside a record at the end of the SHX.
        Throws:
        IOException - in case of error.