Class ShapeSerde
Supports Point, LineString, Polygon, MultiPoint, MultiLineString and MultiPolygon types.
Compatible with the family of ShapeReader classes.
First byte contains ShapeType.id. The rest is type specific. Point: 8 bytes for X
coordinate, followed by 8 bytes for Y coordinate. LineString is serialized as MultiLineString.
MultiLineString: 16 bytes for envelope, 4 bytes for the number of line strings, 4 bytes for total
number of vertices, 16 * num-vertices for XY coordinates of all the vertices. Polygons are
serialized as MultiPolygon. MultiPolygon: 16 bytes for envelope, 4 bytes for the total number of
exterior and interior rings of all polygons, 4 bytes for total number of vertices, 16 *
num-vertices for XY coordinates of all the vertices. The vertices are written one polygon at a
time, exterior ring first, followed by interior rings.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.locationtech.jts.geom.Geometrydeserialize(byte[] input, org.locationtech.jts.geom.GeometryFactory factory) static org.locationtech.jts.geom.Geometrydeserialize(com.esotericsoftware.kryo.io.Input input, org.locationtech.jts.geom.GeometryFactory factory) static byte[]serialize(org.locationtech.jts.geom.Geometry geometry)
-
Constructor Details
-
ShapeSerde
public ShapeSerde()
-
-
Method Details
-
serialize
public static byte[] serialize(org.locationtech.jts.geom.Geometry geometry) -
deserialize
public static org.locationtech.jts.geom.Geometry deserialize(com.esotericsoftware.kryo.io.Input input, org.locationtech.jts.geom.GeometryFactory factory) -
deserialize
public static org.locationtech.jts.geom.Geometry deserialize(byte[] input, org.locationtech.jts.geom.GeometryFactory factory)
-