rdf4j-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...
 

Member Function Documentation

◆ read()

Geometry read ( String  geometryLiteral)

Reimplemented from VectorLiteral.

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

◆ toString()

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

References GMLDatatype.URI.

◆ 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.

Reimplemented from VectorLiteral.

66  {
67  GMLWriter gmlw=new GMLWriter();
68  StringWriter writer=new StringWriter();
69  try {
70  gmlw.write(geometry, writer);
71  return writer.toString();
72  } catch (IOException e) {
73  // TODO Auto-generated catch block
74  e.printStackTrace();
75  return null;
76  }
77 
78  }

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().

◆ URI

final String URI = POSTGIS.GML
static

The default GML type URI.

Referenced by LiteralRegistry.LiteralRegistry(), and GMLDatatype.toString().