Package org.locationtech.jts.io.twkb
Class TWKBWriter
- java.lang.Object
-
- org.locationtech.jts.io.twkb.TWKBWriter
-
public class TWKBWriter extends java.lang.Object
WritesGeometry
s in TWKB (Tiny Well-known Binary) format.The current TWKB specification is https://github.com/TWKB/Specification/blob/master/twkb.md.
-
-
Constructor Summary
Constructors Constructor Description TWKBWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TWKBWriter
setEncodeM(boolean includeMDimension)
TWKBWriter
setEncodeZ(boolean includeZDimension)
TWKBWriter
setIncludeBbox(boolean includeBbox)
Whether the generated TWKB should include a Bounding Box for the geometry.TWKBWriter
setIncludeSize(boolean includeSize)
Whether the generated TWKB should include the size in bytes of the geometry.TWKBWriter
setMPrecision(int mprecision)
Number of base-10 decimal places stored for M dimension.TWKBWriter
setXYPrecision(int xyprecision)
Number of base-10 decimal places stored for X and Y dimensions.TWKBWriter
setZPrecision(int zprecision)
Number of base-10 decimal places stored for Z dimension.byte[]
write(Geometry geom)
void
write(Geometry geom, java.io.DataOutput out)
void
write(Geometry geom, java.io.OutputStream out)
-
-
-
Method Detail
-
setXYPrecision
public TWKBWriter setXYPrecision(int xyprecision)
Number of base-10 decimal places stored for X and Y dimensions.A positive retaining information to the right of the decimal place, negative rounding up to the left of the decimal place).
Defaults to
7
-
setEncodeZ
public TWKBWriter setEncodeZ(boolean includeZDimension)
-
setEncodeM
public TWKBWriter setEncodeM(boolean includeMDimension)
-
setZPrecision
public TWKBWriter setZPrecision(int zprecision)
Number of base-10 decimal places stored for Z dimension.A positive retaining information to the right of the decimal place, negative rounding up to the left of the decimal place).
Defaults to
0
-
setMPrecision
public TWKBWriter setMPrecision(int mprecision)
Number of base-10 decimal places stored for M dimension.A positive retaining information to the right of the decimal place, negative rounding up to the left of the decimal place).
Defaults to
0
-
setIncludeSize
public TWKBWriter setIncludeSize(boolean includeSize)
Whether the generated TWKB should include the size in bytes of the geometry.
-
setIncludeBbox
public TWKBWriter setIncludeBbox(boolean includeBbox)
Whether the generated TWKB should include a Bounding Box for the geometry.
-
write
public byte[] write(Geometry geom)
-
write
public void write(Geometry geom, java.io.OutputStream out) throws java.io.IOException
- Throws:
java.io.IOException
-
write
public void write(Geometry geom, java.io.DataOutput out) throws java.io.IOException
- Throws:
java.io.IOException
-
-