java.lang.Object
org.apache.jena.datatypes.BaseDatatype
org.apache.jena.geosparql.implementation.datatype.GeometryDatatype
org.apache.jena.geosparql.implementation.datatype.WKTDatatype
All Implemented Interfaces:
org.apache.jena.datatypes.RDFDatatype

public class WKTDatatype extends GeometryDatatype
WKTDatatype class allows the URI "geo:wktLiteral" to be used as a datatype and it will parse that datatype to a JTS Geometry. Req 10 All RDFS Literals of type geo:wktLiteral shall consist of an optional URI identifying the coordinate reference system followed by Simple Features Well Known Text (WKT) describing a geometric value. Valid geo:wktLiterals are formed by concatenating a valid, absolute URI as defined in [RFC 2396], one or more spaces (Unicode U+0020 character) as a separator, and a WKT string as defined in Simple Features [ISO 19125-1]. Req 11 The URI <http://www.opengis.net/def/crs/OGC/1.3/CRS84> shall be assumed as the spatial reference system for geo:wktLiterals that do not * specify an explicit spatial reference system URI.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.jena.datatypes.BaseDatatype

    org.apache.jena.datatypes.BaseDatatype.TypedValue
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final WKTDatatype
    A static instance of WKTDatatype.
    static final String
    The default WKT type URI.
  • Method Summary

    Modifier and Type
    Method
    Description
    read(String geometryLiteral)
     
     
    unparse(Object geometry)
    This method Un-parses the JTS Geometry to the WKT literal

    Methods inherited from class org.apache.jena.geosparql.implementation.datatype.GeometryDatatype

    check, checkURI, get, get, parse, parse, registerDatatypes

    Methods inherited from class org.apache.jena.datatypes.BaseDatatype

    cannonicalise, equals, extendedTypeDefinition, getHashCode, getJavaClass, getURI, hashCode, isEqual, isValid, isValidLiteral, isValidValue, langTagCompatible, normalizeSubType

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Method Details

    • unparse

      public String unparse(Object geometry)
      This method Un-parses the JTS Geometry to the WKT literal
      Specified by:
      unparse in interface org.apache.jena.datatypes.RDFDatatype
      Overrides:
      unparse in class org.apache.jena.datatypes.BaseDatatype
      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.
    • read

      public GeometryWrapper read(String geometryLiteral)
      Specified by:
      read in class GeometryDatatype
    • toString

      public String toString()
      Overrides:
      toString in class org.apache.jena.datatypes.BaseDatatype