Class WKBReader

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

public class WKBReader extends Object
This code is a custom modified version of JTS WKBReader
  • Constructor Details

    • WKBReader

      public WKBReader()
      Default constructor uses a JTS Array-based sequence factory.
    • WKBReader

      public WKBReader(org.locationtech.jts.geom.GeometryFactory geometryFactory)
  • Method Details

    • hexToBytes

      public static byte[] hexToBytes(String hex)
      Converts a hexadecimal string to a byte array. The hexadecimal digit symbols are case-insensitive.
      Parameters:
      hex - a string containing hex digits
      Returns:
      an array of bytes with the value of the hex string
    • read

      public Geography read(byte[] bytes) throws org.locationtech.jts.io.ParseException
      Reads a single Geography in WKB format from a byte array.
      Parameters:
      bytes - the byte array to read from
      Returns:
      the geometry read
      Throws:
      org.locationtech.jts.io.ParseException - if the WKB is ill-formed
    • read

      public Geography read(org.locationtech.jts.io.InStream is) throws IOException, org.locationtech.jts.io.ParseException
      Reads a Geography in binary WKB format from an InStream.
      Parameters:
      is - the stream to read from
      Returns:
      the Geometry read
      Throws:
      IOException - if the underlying stream creates an error
      org.locationtech.jts.io.ParseException - if the WKB is ill-formed