Class JtsBinaryCodec
- java.lang.Object
-
- org.locationtech.spatial4j.io.BinaryCodec
-
- org.locationtech.spatial4j.io.jts.JtsBinaryCodec
-
public class JtsBinaryCodec extends BinaryCodec
Writes shapes in WKB, if it isn't otherwise supported by the superclass.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
useFloat
-
Fields inherited from class org.locationtech.spatial4j.io.BinaryCodec
ctx, TYPE_CIRCLE, TYPE_COLL, TYPE_GEOM, TYPE_POINT, TYPE_RECT
-
-
Constructor Summary
Constructors Constructor Description JtsBinaryCodec(JtsSpatialContext ctx, JtsSpatialContextFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
readDim(DataInput dataInput)
Shape
readJtsGeom(DataInput dataInput)
protected Shape
readShapeByTypeIfSupported(DataInput dataInput, byte type)
protected byte
typeForShape(Shape s)
protected void
writeDim(DataOutput dataOutput, double v)
void
writeJtsGeom(DataOutput dataOutput, Shape s)
protected boolean
writeShapeByTypeIfSupported(DataOutput dataOutput, Shape s, byte type)
-
Methods inherited from class org.locationtech.spatial4j.io.BinaryCodec
readCircle, readCollection, readPoint, readRect, readShape, writeCircle, writeCollection, writePoint, writeRect, writeShape, writeShapeByTypeIfSupported
-
-
-
-
Constructor Detail
-
JtsBinaryCodec
public JtsBinaryCodec(JtsSpatialContext ctx, JtsSpatialContextFactory factory)
-
-
Method Detail
-
readDim
protected double readDim(DataInput dataInput) throws IOException
- Overrides:
readDim
in classBinaryCodec
- Throws:
IOException
-
writeDim
protected void writeDim(DataOutput dataOutput, double v) throws IOException
- Overrides:
writeDim
in classBinaryCodec
- Throws:
IOException
-
typeForShape
protected byte typeForShape(Shape s)
- Overrides:
typeForShape
in classBinaryCodec
-
readShapeByTypeIfSupported
protected Shape readShapeByTypeIfSupported(DataInput dataInput, byte type) throws IOException
- Overrides:
readShapeByTypeIfSupported
in classBinaryCodec
- Throws:
IOException
-
writeShapeByTypeIfSupported
protected boolean writeShapeByTypeIfSupported(DataOutput dataOutput, Shape s, byte type) throws IOException
- Overrides:
writeShapeByTypeIfSupported
in classBinaryCodec
- Throws:
IOException
-
readJtsGeom
public Shape readJtsGeom(DataInput dataInput) throws IOException
- Throws:
IOException
-
writeJtsGeom
public void writeJtsGeom(DataOutput dataOutput, Shape s) throws IOException
- Throws:
IOException
-
-