java.lang.Object
org.elasticsearch.geometry.utils.WellKnownBinary
Utility class for converting
Geometry to and from WKB-
Method Summary
Modifier and TypeMethodDescriptionstatic GeometryfromWKB(GeometryValidator validator, boolean coerce, byte[] wkb) Reads aGeometryfrom the given WKB byte array.static GeometryfromWKB(GeometryValidator validator, boolean coerce, byte[] wkb, int offset, int length) Reads aGeometryfrom the given WKB byte array with offset.static byte[]static byte[]fromWKT(String wkt, ByteOrder byteOrder, boolean coerce, GeometryValidator validator) static byte[]
-
Method Details
-
toWKB
-
fromWKT
public static byte[] fromWKT(String wkt, ByteOrder byteOrder, boolean coerce, GeometryValidator validator) throws IOException, ParseException Converts a WKT string directly to WKB with the providedByteOrder, without building intermediateGeometryobjects. Each parsed coordinate is validated inline viaGeometryValidator.validateCoordinate(double, double, double); passGeometryValidator.NOOPto skip validation.- Parameters:
wkt- the WKT string to parsebyteOrder- the byte order for the WKB outputcoerce- if true, unclosed polygon rings are automatically closedvalidator- called for each coordinate as it is parsed- Throws:
IOException- if an I/O error occurs while reading the WKT stringParseException- if the WKT string is malformed
-
fromWKT
public static byte[] fromWKT(String wkt, ByteOrder byteOrder, boolean coerce) throws IOException, ParseException Converts a WKT string directly to WKB with the providedByteOrder, without building intermediateGeometryobjects. No coordinate validation is performed.- Parameters:
wkt- the WKT string to parsebyteOrder- the byte order for the WKB outputcoerce- if true, unclosed polygon rings are automatically closed- Throws:
IOException- if an I/O error occurs while reading the WKT stringParseException- if the WKT string is malformed
-
fromWKB
Reads aGeometryfrom the given WKB byte array. -
fromWKB
public static Geometry fromWKB(GeometryValidator validator, boolean coerce, byte[] wkb, int offset, int length) Reads aGeometryfrom the given WKB byte array with offset.
-