}
@Override
public void setValue(PreparedStatement st, int startIndex, Geometry value) throws SQLException {
WkbEncoder encoder = Wkb.newEncoder(Wkb.Dialect.POSTGIS_EWKB_1);
ByteBuffer buffer = encoder.encode(value, byteOrder);
int srid = value.getSRID();
// prepend srid into first 4 bytes
byte[] wkb = buffer.toByteArray();
byte[] bytes = new byte[wkb.length + 4];
bytes[3] = (byte) ((srid >> 24) & 0xFF);
bytes[2] = (byte) ((srid >> 16) & 0xFF);
bytes[1] = (byte) ((srid >> 8) & 0xFF);
bytes[0] = (byte) (srid & 0xFF);