Class WKBWriter

java.lang.Object
org.apache.sedona.common.S2Geography.WKBWriter

public class WKBWriter extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a writer that writes Geometrys with output dimension = 2 and BIG_ENDIAN byte order
    WKBWriter(int outputDimension)
    Creates a writer that writes Geometrys with the given dimension (2 or 3) for output coordinates and ByteOrderValues.BIG_ENDIAN byte order.
    WKBWriter(int outputDimension, boolean includeSRID)
     
    WKBWriter(int outputDimension, int byteOrder)
     
    WKBWriter(int outputDimension, int byteOrder, boolean includeSRID)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    bytesToHex(byte[] bytes)
    Deprecated. 
    EnumSet<org.locationtech.jts.io.Ordinate>
    Gets a bit-pattern defining which ordinates should be
    void
    setOutputOrdinates(EnumSet<org.locationtech.jts.io.Ordinate> outputOrdinates)
    Sets the Ordinate that are to be written.
    static String
    toHex(byte[] bytes)
    Converts a byte array to a hexadecimal string.
    byte[]
    Writes a Geography into a byte array.
    void
    write(Geography geogIn, org.locationtech.jts.io.OutStream os)
    Writes a Geography to an OutStream.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WKBWriter

      public WKBWriter()
      Creates a writer that writes Geometrys with output dimension = 2 and BIG_ENDIAN byte order
    • WKBWriter

      public WKBWriter(int outputDimension)
      Creates a writer that writes Geometrys with the given dimension (2 or 3) for output coordinates and ByteOrderValues.BIG_ENDIAN byte order. If the input geometry has a small coordinate dimension, coordinates will be padded with Coordinate.NULL_ORDINATE.
      Parameters:
      outputDimension - the coordinate dimension to output (2 or 3)
    • WKBWriter

      public WKBWriter(int outputDimension, boolean includeSRID)
    • WKBWriter

      public WKBWriter(int outputDimension, int byteOrder)
    • WKBWriter

      public WKBWriter(int outputDimension, int byteOrder, boolean includeSRID)
  • Method Details

    • bytesToHex

      public static String bytesToHex(byte[] bytes)
      Deprecated.
      Converts a byte array to a hexadecimal string.
      Parameters:
      bytes -
      Returns:
      a string of hexadecimal digits
    • toHex

      public static String toHex(byte[] bytes)
      Converts a byte array to a hexadecimal string.
      Parameters:
      bytes - a byte array
      Returns:
      a string of hexadecimal digits
    • setOutputOrdinates

      public void setOutputOrdinates(EnumSet<org.locationtech.jts.io.Ordinate> outputOrdinates)
      Sets the Ordinate that are to be written. Possible members are:
      • Ordinate.X
      • Ordinate.Y
      • Ordinate.Z
      • Ordinate.M
      Values of Ordinate.X and Ordinate.Y are always assumed and not particularly checked for.
      Parameters:
      outputOrdinates - A set of Ordinate values
    • getOutputOrdinates

      public EnumSet<org.locationtech.jts.io.Ordinate> getOutputOrdinates()
      Gets a bit-pattern defining which ordinates should be
      Returns:
      an ordinate bit-pattern
      See Also:
    • write

      public byte[] write(Geography geog)
      Writes a Geography into a byte array.
      Parameters:
      geog - the geometry to write
      Returns:
      the byte array containing the WKB
    • write

      public void write(Geography geogIn, org.locationtech.jts.io.OutStream os) throws IOException
      Writes a Geography to an OutStream.
      Parameters:
      geogIn - the geography to write
      os - the out stream to write to
      Throws:
      IOException - if an I/O error occurs