Class PostgisCodec

java.lang.Object
org.jdbi.v3.postgis.PostgisCodec
All Implemented Interfaces:
Codec<org.locationtech.jts.geom.Geometry>

@Alpha final class PostgisCodec extends Object implements Codec<org.locationtech.jts.geom.Geometry>
  • Constructor Details

    • PostgisCodec

      PostgisCodec()
  • Method Details

    • getColumnMapper

      public ColumnMapper<org.locationtech.jts.geom.Geometry> getColumnMapper()
      Description copied from interface: Codec
      Returns a ColumnMapper that creates an attribute value from a database column.

      Either this method or Codec.getColumnMapper(ConfigRegistry) must be implemented.

      Specified by:
      getColumnMapper in interface Codec<org.locationtech.jts.geom.Geometry>
    • getArgumentFunction

      public Function<org.locationtech.jts.geom.Geometry,Argument> getArgumentFunction()
      Description copied from interface: Codec
      Returns a Function that creates an Argument to map an attribute value onto the database column.

      Either this method or Codec.getArgumentFunction(ConfigRegistry) must be implemented.

      Specified by:
      getArgumentFunction in interface Codec<org.locationtech.jts.geom.Geometry>
    • serialize

      private static byte[] serialize(org.locationtech.jts.geom.Geometry geometry)
      Serializes a geometry in the WKB format.
      Parameters:
      geometry - An Geometry object or one of its subclasses. May be null.
      Returns:
      A byte array representing the Geometry object in WKB format or null if the object was null.
    • deserialize

      private static org.locationtech.jts.geom.Geometry deserialize(byte[] bytes)
      Deserializes a geometry in the WKB format.
      Parameters:
      bytes - A byte array representing a Geometry in WKB format or null.
      Returns:
      The deserialized object or null if the byte array was null.
    • hexStringToByteArray

      private static byte[] hexStringToByteArray(String s)