Package org.geolatte.geom.codec
Class Wkt
- java.lang.Object
-
- org.geolatte.geom.codec.Wkt
-
public class Wkt extends Object
Creates encoders/decoders for WKT geometry representations.Note that the
WktEncoder /WktDecoderinstances returned by the factory methods are not thread-safe.- Author:
- Karel Maesen, Geovise BVBA, 2011
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWkt.Dialect
-
Constructor Summary
Constructors Constructor Description Wkt()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Geometry<?>fromWkt(String wkt)static <P extends Position>
Geometry<P>fromWkt(String wkt, CoordinateReferenceSystem<P> crs)Decodes the specified WKT String to aGeometry.static WktDecodernewDecoder()Creates aWktDecoderfor the default dialect (Postgis 1.x EWKT).static WktDecodernewDecoder(Wkt.Dialect dialect)Creates aWktDecoderfor the specified WKTDialect.static WktEncodernewEncoder()Creates aWktEncoderfor the default dialect (Postgis 1.x EWKT).static WktEncodernewEncoder(Wkt.Dialect dialect)Creates aWktEncoderfor the specified WKTDialect.static StringtoWkt(Geometry<?> geometry)Encodes aGeometryto a WKT representation.
-
-
-
Method Detail
-
fromWkt
public static <P extends Position> Geometry<P> fromWkt(String wkt, CoordinateReferenceSystem<P> crs)
Decodes the specified WKT String to aGeometry.This method uses the default WKT dialect (Postgis v1.5 EWKT)
- Parameters:
wkt- the WKT string to decode- Returns:
- The decoded Geometry
-
toWkt
public static String toWkt(Geometry<?> geometry)
Encodes aGeometryto a WKT representation.This method uses the default WKT dialect (Postgis v1.5 EWKT)
- Parameters:
geometry- theGeometryto encode- Returns:
- the WKT representation of the given geometry
-
newDecoder
public static WktDecoder newDecoder(Wkt.Dialect dialect)
Creates aWktDecoderfor the specified WKTDialect.- Parameters:
dialect- the WKT dialect- Returns:
- an
WktDecoderthat supports the specified dialect
-
newDecoder
public static WktDecoder newDecoder()
Creates aWktDecoderfor the default dialect (Postgis 1.x EWKT).- Returns:
- an
WktDecoderthat supports the default dialect
-
newEncoder
public static WktEncoder newEncoder(Wkt.Dialect dialect)
Creates aWktEncoderfor the specified WKTDialect.- Parameters:
dialect- the WKT dialect- Returns:
- an
WktEncoderthat supports the specified dialect
-
newEncoder
public static WktEncoder newEncoder()
Creates aWktEncoderfor the default dialect (Postgis 1.x EWKT).- Returns:
- an
WktEncoderthat supports the default dialect
-
-