Package org.apache.calcite.runtime
Class SpatialTypeUtils
java.lang.Object
org.apache.calcite.runtime.SpatialTypeUtils
Utilities for spatial types.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Geometry types, with the names and codes assigned by OGC. -
Field Summary
Modifier and TypeFieldDescriptionstatic final org.locationtech.jts.geom.GeometryFactory
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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
fromGeoJson
(String geoJson) 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.
-
Field Details
-
GEOMETRY_FACTORY
public static final org.locationtech.jts.geom.GeometryFactory GEOMETRY_FACTORY
-
-
Method Details
-
fromGeoJson
Constructs a geometry from a GeoJson representation.- Parameters:
geoJson
- a GeoJson- Returns:
- a geometry
-
fromGml
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
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
Constructs a geometry from a Well-Known text (WKT) representation.- Parameters:
wkt
- a WKT- Returns:
- a geometry
-
asGeoJson
Returns the GeoJson representation of the geometry.- Parameters:
geometry
- a geometry- Returns:
- a GeoJson
-
asGml
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
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
Returns the Well-Known text (WKT) representation of the geometry.- Parameters:
geometry
- a geometry- Returns:
- a WKT
-