Package org.locationtech.jts.io.twkb
Class TWKBWriter
- java.lang.Object
-
- org.locationtech.jts.io.twkb.TWKBWriter
-
public class TWKBWriter extends Object
WritesGeometrys 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 TWKBWritersetEncodeM(boolean includeMDimension)TWKBWritersetEncodeZ(boolean includeZDimension)TWKBWritersetIncludeBbox(boolean includeBbox)Whether the generated TWKB should include a Bounding Box for the geometry.TWKBWritersetIncludeSize(boolean includeSize)Whether the generated TWKB should include the size in bytes of the geometry.TWKBWritersetMPrecision(int mprecision)Number of base-10 decimal places stored for M dimension.TWKBWritersetXYPrecision(int xyprecision)Number of base-10 decimal places stored for X and Y dimensions.TWKBWritersetZPrecision(int zprecision)Number of base-10 decimal places stored for Z dimension.byte[]write(Geometry geom)voidwrite(Geometry geom, DataOutput out)voidwrite(Geometry geom, 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, OutputStream out) throws IOException
- Throws:
IOException
-
write
public void write(Geometry geom, DataOutput out) throws IOException
- Throws:
IOException
-
-