Ejemplo n.º 1
0
 @Override
 public void setValue(PreparedStatement st, int startIndex, T value) throws SQLException {
   WkbEncoder encoder = Wkb.newEncoder(Wkb.Dialect.POSTGIS_EWKB_1);
   ByteBuffer buffer = encoder.encode(value, byteOrder);
   st.setBytes(startIndex, buffer.toByteArray());
 }
Ejemplo n.º 2
0
 /**
  * Encode the specified {@code Geometry} into a WKB
  *
  * @param geometry The value to encode
  * @return A byte-array representing the geometry in WKB.
  */
 public static byte[] to(Geometry geometry) {
   final WkbEncoder encoder = Wkb.newEncoder(Wkb.Dialect.POSTGIS_EWKB_1);
   final ByteBuffer buffer = encoder.encode(geometry, ByteOrder.NDR);
   return (buffer == null ? null : buffer.toByteArray());
 }