Class SpatialTypeUtils

java.lang.Object
org.apache.calcite.runtime.SpatialTypeUtils

public class SpatialTypeUtils extends Object
Utilities for spatial types.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Geometry types, with the names and codes assigned by OGC.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.locationtech.jts.geom.GeometryFactory
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    asEwkt(org.locationtech.jts.geom.Geometry geometry)
    Returns the Extended Well-Known text (EWKT) representation of the geometry.
    static String
    asGeoJson(org.locationtech.jts.geom.Geometry geometry)
    Returns the GeoJson representation of the geometry.
    static String
    asGml(org.locationtech.jts.geom.Geometry geometry)
    Returns the GML representation of the geometry.
    static org.apache.calcite.avatica.util.ByteString
    asWkb(org.locationtech.jts.geom.Geometry geometry)
    Returns the Extended Well-Known binary (WKB) representation of the geometry.
    static String
    asWkt(org.locationtech.jts.geom.Geometry geometry)
    Returns the Well-Known text (WKT) representation of the geometry.
    static org.locationtech.jts.geom.Geometry
    Constructs a geometry from an Extended Well-Known text (EWKT) representation.
    static org.locationtech.jts.geom.Geometry
    Constructs a geometry from a GeoJson representation.
    static org.locationtech.jts.geom.Geometry
    Constructs a geometry from a GML representation.
    static org.locationtech.jts.geom.Geometry
    fromWkb(org.apache.calcite.avatica.util.ByteString wkb)
    Constructs a geometry from a Well-Known binary (WKB) representation.
    static org.locationtech.jts.geom.Geometry
    Constructs a geometry from a Well-Known text (WKT) representation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • GEOMETRY_FACTORY

      public static final org.locationtech.jts.geom.GeometryFactory GEOMETRY_FACTORY
  • Method Details

    • fromGeoJson

      public static org.locationtech.jts.geom.Geometry fromGeoJson(String geoJson)
      Constructs a geometry from a GeoJson representation.
      Parameters:
      geoJson - a GeoJson
      Returns:
      a geometry
    • fromGml

      public static org.locationtech.jts.geom.Geometry fromGml(String gml)
      Constructs a geometry from a GML representation.
      Parameters:
      gml - a GML
      Returns:
      a geometry
    • fromWkb

      public static org.locationtech.jts.geom.Geometry fromWkb(org.apache.calcite.avatica.util.ByteString wkb)
      Constructs a geometry from a Well-Known binary (WKB) representation.
      Parameters:
      wkb - a WKB
      Returns:
      a geometry
    • fromEwkt

      public static org.locationtech.jts.geom.Geometry fromEwkt(String ewkt)
      Constructs a geometry from an Extended Well-Known text (EWKT) representation. EWKT representations are prefixed with the SRID.
      Parameters:
      ewkt - an EWKT
      Returns:
      a geometry
    • fromWkt

      public static org.locationtech.jts.geom.Geometry fromWkt(String wkt)
      Constructs a geometry from a Well-Known text (WKT) representation.
      Parameters:
      wkt - a WKT
      Returns:
      a geometry
    • asGeoJson

      public static String asGeoJson(org.locationtech.jts.geom.Geometry geometry)
      Returns the GeoJson representation of the geometry.
      Parameters:
      geometry - a geometry
      Returns:
      a GeoJson
    • asGml

      public static String asGml(org.locationtech.jts.geom.Geometry geometry)
      Returns the GML representation of the geometry.
      Parameters:
      geometry - a geometry
      Returns:
      a GML
    • asWkb

      public static org.apache.calcite.avatica.util.ByteString asWkb(org.locationtech.jts.geom.Geometry geometry)
      Returns the Extended Well-Known binary (WKB) representation of the geometry.
      Parameters:
      geometry - a geometry
      Returns:
      an WKB
    • asEwkt

      public static String asEwkt(org.locationtech.jts.geom.Geometry geometry)
      Returns the Extended Well-Known text (EWKT) representation of the geometry. EWKT representations are prefixed with the SRID.
      Parameters:
      geometry - a geometry
      Returns:
      an EWKT
    • asWkt

      public static String asWkt(org.locationtech.jts.geom.Geometry geometry)
      Returns the Well-Known text (WKT) representation of the geometry.
      Parameters:
      geometry - a geometry
      Returns:
      a WKT