Package org.jdbi.v3.postgis
Class PostgisCodec
java.lang.Object
org.jdbi.v3.postgis.PostgisCodec
- All Implemented Interfaces:
Codec<org.locationtech.jts.geom.Geometry>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static org.locationtech.jts.geom.Geometrydeserialize(byte[] bytes) Deserializes a geometry in the WKB format.ColumnMapper<org.locationtech.jts.geom.Geometry>Returns aColumnMapperthat creates an attribute value from a database column.private static byte[]private static byte[]serialize(org.locationtech.jts.geom.Geometry geometry) Serializes a geometry in the WKB format.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jdbi.v3.core.codec.Codec
getArgumentFunction, getColumnMapper
-
Constructor Details
-
PostgisCodec
PostgisCodec()
-
-
Method Details
-
getColumnMapper
Description copied from interface:CodecReturns aColumnMapperthat creates an attribute value from a database column.Either this method or
Codec.getColumnMapper(ConfigRegistry)must be implemented.- Specified by:
getColumnMapperin interfaceCodec<org.locationtech.jts.geom.Geometry>
-
getArgumentFunction
Description copied from interface:CodecReturns aFunctionthat creates anArgumentto map an attribute value onto the database column.Either this method or
Codec.getArgumentFunction(ConfigRegistry)must be implemented.- Specified by:
getArgumentFunctionin interfaceCodec<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- AnGeometryobject 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 aGeometryin WKB format or null.- Returns:
- The deserialized object or null if the byte array was null.
-
hexStringToByteArray
-