kiwi-postgis  Version 0.1.0.0
WKTDatatype Class Reference
Inheritance diagram for WKTDatatype:
Collaboration diagram for WKTDatatype:

Classes

class  WKBTextSRS
 

Public Member Functions

String unparse (Geometry geometry)
 This method Un-parses the JTS Geometry to the WKT literal. More...
 
Geometry read (String geometryLiteral)
 
String toString ()
 

Static Public Attributes

static final String URI = POSTGIS.NAMESPACE+POSTGIS.WKT.toLowerCase()+"Literal"
 The default WKT type URI. More...
 
static final WKTDatatype INSTANCE = new WKTDatatype()
 A static instance of WKTDatatype. More...
 

Member Function Documentation

◆ read()

Geometry read ( String  geometryLiteral)

References WKTDatatype.WKBTextSRS.getWkbText().

37  {
38  WKBTextSRS wkbTextSRS = new WKBTextSRS(geometryLiteral);
39 
40  WKTReader wkbReader = new WKTReader();
41  Geometry geometry;
42  try {
43  geometry = wkbReader.read(wkbTextSRS.getWkbText());
44  return geometry;
45  } catch (ParseException e) {
46  throw new RuntimeException(e.getMessage());
47  }
48 
49 
50  }

◆ toString()

String toString ( )
83  {
84  return "WKTDatatype{" + URI + '}';
85  }
static final String URI
The default WKT type URI.
Definition: WKTDatatype.java:14

◆ unparse()

String unparse ( Geometry  geometry)

This method Un-parses the JTS Geometry to the WKT literal.

Parameters
geometry- the JTS Geometry to be un-parsed
Returns
WKT - the returned WKT Literal.
Notice that the Spatial Reference System is not specified in returned WKT literal.
31  {
32  WKTWriter writer=new WKTWriter();
33  return writer.write(geometry).toString();
34  }

Member Data Documentation

◆ INSTANCE

final WKTDatatype INSTANCE = new WKTDatatype()
static

A static instance of WKTDatatype.

Referenced by LiteralRegistry.LiteralRegistry().

◆ URI

final String URI = POSTGIS.NAMESPACE+POSTGIS.WKT.toLowerCase()+"Literal"
static

The default WKT type URI.

Referenced by LiteralRegistry.LiteralRegistry().