Class WKBWriter
java.lang.Object
org.apache.sedona.common.S2Geography.WKBWriter
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a writer that writesGeometrys with output dimension = 2 and BIG_ENDIAN byte orderWKBWriter(int outputDimension) Creates a writer that writesGeometrys with the given dimension (2 or 3) for output coordinates andByteOrderValues.BIG_ENDIANbyte order.WKBWriter(int outputDimension, boolean includeSRID) WKBWriter(int outputDimension, int byteOrder) WKBWriter(int outputDimension, int byteOrder, boolean includeSRID) -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbytesToHex(byte[] bytes) Deprecated.EnumSet<org.locationtech.jts.io.Ordinate>Gets a bit-pattern defining which ordinates should bevoidsetOutputOrdinates(EnumSet<org.locationtech.jts.io.Ordinate> outputOrdinates) Sets theOrdinatethat are to be written.static StringtoHex(byte[] bytes) Converts a byte array to a hexadecimal string.byte[]Writes aGeographyinto a byte array.voidWrites aGeographyto anOutStream.
-
Constructor Details
-
WKBWriter
public WKBWriter()Creates a writer that writesGeometrys with output dimension = 2 and BIG_ENDIAN byte order -
WKBWriter
public WKBWriter(int outputDimension) Creates a writer that writesGeometrys with the given dimension (2 or 3) for output coordinates andByteOrderValues.BIG_ENDIANbyte order. If the input geometry has a small coordinate dimension, coordinates will be padded withCoordinate.NULL_ORDINATE.- Parameters:
outputDimension- the coordinate dimension to output (2 or 3)
-
WKBWriter
public WKBWriter(int outputDimension, boolean includeSRID) -
WKBWriter
public WKBWriter(int outputDimension, int byteOrder) -
WKBWriter
public WKBWriter(int outputDimension, int byteOrder, boolean includeSRID)
-
-
Method Details
-
bytesToHex
Deprecated.Converts a byte array to a hexadecimal string.- Parameters:
bytes-- Returns:
- a string of hexadecimal digits
-
toHex
Converts a byte array to a hexadecimal string.- Parameters:
bytes- a byte array- Returns:
- a string of hexadecimal digits
-
setOutputOrdinates
Sets theOrdinatethat are to be written. Possible members are:Ordinate.XOrdinate.YOrdinate.ZOrdinate.M
Ordinate.XandOrdinate.Yare always assumed and not particularly checked for.- Parameters:
outputOrdinates- A set ofOrdinatevalues
-
getOutputOrdinates
Gets a bit-pattern defining which ordinates should be- Returns:
- an ordinate bit-pattern
- See Also:
-
write
Writes aGeographyinto a byte array.- Parameters:
geog- the geometry to write- Returns:
- the byte array containing the WKB
-
write
Writes aGeographyto anOutStream.- Parameters:
geogIn- the geography to writeos- the out stream to write to- Throws:
IOException- if an I/O error occurs
-