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

Public Member Functions

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

Static Public Attributes

static final String URI = POSTGIS.GML
 The default GML type URI. More...
 
static final GMLDatatype INSTANCE = new GMLDatatype()
 A static instance of GMLDatatype. More...
 
static final String GML_PREFIX = "gml"
 XML element tag "gml" is defined for the convenience of GML generation. More...
 

Static Private Attributes

static final Logger LOGGER = LoggerFactory.getLogger(GMLDatatype.class)
 

Member Function Documentation

◆ read()

Geometry read ( String  geometryLiteral)
83  {
84  StringReader reader=new StringReader(geometryLiteral);
85  GMLReader read=new GMLReader();
86  Geometry geom;
87  try {
88  geom = read.read(reader, new GeometryFactory());
89  return geom;
90  } catch (SAXException | IOException | ParserConfigurationException e) {
91  // TODO Auto-generated catch block
92  e.printStackTrace();
93  }
94  return null;
95  }
Geometry read(String geometryLiteral)
Definition: GMLDatatype.java:83

◆ toString()

String toString ( )
98  {
99  return "GMLDatatype{" + URI + '}';
100  }
static final String URI
The default GML type URI.
Definition: GMLDatatype.java:47

◆ unparse()

String unparse ( Geometry  geometry)

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

Parameters
geometry- the JTS Geometry to be un-parsed
Returns
GML - the returned GML Literal.
Notice that the Spatial Reference System "urn:ogc:def:crs:OGC::CRS84" is predefined in the returned GML literal.
68  {
69  GMLWriter gmlw=new GMLWriter();
70  StringWriter writer=new StringWriter();
71  try {
72  gmlw.write(geometry, writer);
73  return writer.toString();
74  } catch (IOException e) {
75  // TODO Auto-generated catch block
76  e.printStackTrace();
77  return null;
78  }
79 
80  }

Member Data Documentation

◆ GML_PREFIX

final String GML_PREFIX = "gml"
static

XML element tag "gml" is defined for the convenience of GML generation.

◆ INSTANCE

final GMLDatatype INSTANCE = new GMLDatatype()
static

A static instance of GMLDatatype.

Referenced by LiteralRegistry.LiteralRegistry().

◆ LOGGER

final Logger LOGGER = LoggerFactory.getLogger(GMLDatatype.class)
staticprivate

◆ URI

final String URI = POSTGIS.GML
static

The default GML type URI.

Referenced by LiteralRegistry.LiteralRegistry().