Class ShpGeometryEncoder
java.lang.Object
ch.so.agi.gretl.internal.shapefile.geom.ShpGeometryEncoder
Encodes a
com.vividsolutions.jts geometry into a single EncodedShape, i.e. the
little-endian content of one Shapefile record (including the leading shape-type integer).
This is the symmetric counterpart of ShpGeometryDecoder. It keeps all JTS encoding
logic out of the core package, exactly like the decoder keeps JTS decoding logic here.
MVP mapping:
null/empty geometry →NULLshape (type 0)Point→ Point (type 1)LineString/MultiLineString→ PolyLine (type 3)Polygon/MultiPolygon→ Polygon (type 5)
Polygon ring orientation is normalised so the result round-trips through
ShpGeometryDecoder: shells are emitted clockwise (signed area < 0) and holes counter-clockwise.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ShpGeometryEncoder
public ShpGeometryEncoder()
-
-
Method Details
-
encode
public EncodedShape encode(com.vividsolutions.jts.geom.Geometry geometry) throws ShapefileMappingException - Throws:
ShapefileMappingException
-