public class Wkt
extends java.lang.Object
Note that the WktDecoder instances returned by the factory
methods are not thread-safe.
| Modifier and Type | Class and Description |
|---|---|
static class |
Wkt.Dialect |
| Modifier and Type | Field and Description |
|---|---|
private static java.util.Map<Wkt.Dialect,java.lang.Class<? extends WktDecoder>> |
DECODERS |
private static Wkt.Dialect |
DEFAULT_DIALECT |
private static java.util.Map<Wkt.Dialect,java.lang.Class<? extends WktEncoder>> |
ENCODERS |
| Constructor and Description |
|---|
Wkt() |
| Modifier and Type | Method and Description |
|---|---|
private static <T> T |
createInstance(java.lang.Class<? extends T> codecClass) |
static Geometry<?> |
fromWkt(java.lang.String wkt) |
static <P extends Position> |
fromWkt(java.lang.String wkt,
CoordinateReferenceSystem<P> crs)
Decodes the specified WKT String to a
Geometry. |
static WktDecoder |
newDecoder()
Creates a
WktDecoder for the default dialect (Postgis 1.x EWKT). |
static WktDecoder |
newDecoder(Wkt.Dialect dialect)
Creates a
WktDecoder for the specified WKT Dialect. |
static WktEncoder |
newEncoder()
Creates a
WktEncoder for the default dialect (Postgis 1.x EWKT). |
static WktEncoder |
newEncoder(Wkt.Dialect dialect)
Creates a
WktEncoder for the specified WKT Dialect. |
static java.lang.String |
toWkt(Geometry<?> geometry)
Encodes a
Geometry to a WKT representation. |
private static final Wkt.Dialect DEFAULT_DIALECT
private static final java.util.Map<Wkt.Dialect,java.lang.Class<? extends WktDecoder>> DECODERS
private static final java.util.Map<Wkt.Dialect,java.lang.Class<? extends WktEncoder>> ENCODERS
public static <P extends Position> Geometry<P> fromWkt(java.lang.String wkt, CoordinateReferenceSystem<P> crs)
Geometry.
This method uses the default WKT dialect (Postgis v1.5 EWKT)
wkt - the WKT string to decodepublic static Geometry<?> fromWkt(java.lang.String wkt)
public static java.lang.String toWkt(Geometry<?> geometry)
Geometry to a WKT representation.
This method uses the default WKT dialect (Postgis v1.5 EWKT)
geometry - the Geometry to encodepublic static WktDecoder newDecoder(Wkt.Dialect dialect)
WktDecoder for the specified WKT Dialect.dialect - the WKT dialectWktDecoder that supports the specified dialectpublic static WktDecoder newDecoder()
WktDecoder for the default dialect (Postgis 1.x EWKT).WktDecoder that supports the default dialectpublic static WktEncoder newEncoder(Wkt.Dialect dialect)
WktEncoder for the specified WKT Dialect.dialect - the WKT dialectWktEncoder that supports the specified dialectpublic static WktEncoder newEncoder()
WktEncoder for the default dialect (Postgis 1.x EWKT).WktEncoder that supports the default dialectprivate static <T> T createInstance(java.lang.Class<? extends T> codecClass)