Spatial data represents spatial objects, their geographic locations, and their shapes. This data is often used in fields such as aviation, navigation, and urban planning. This topic describes the spatial data types that LindormTable supports.
Applicable engines
Spatial data types are available only for LindormTable.
Spatial data types
Lindorm GanosBase supports the following spatial data types:
Data type | Description | Usage example |
Geometry | Represents a generic spatial object. It is the parent type of Point, LineString, Polygon, MultiPoint, MultiPolygon, MultiLineString, and GeometryCollection. Avoid defining a spatial column directly as Geometry. Note
| Specify the data type of a spatial column when you create a spatio-temporal data table. |
Point | Represents point data, which consists of a longitude (x) and a latitude (y) coordinate. Note Three-dimensional (3D) point coordinates are not supported for calculations. Stored 3D points are converted to two-dimensional (2D) points for calculations. | GPS coordinate information received by vehicles and ships. |
LineString | Represents line data, which consists of two or more points. The endpoint of one line segment is the start point of the next. Note A LineString must have two or more points. Consecutive vertices can be identical. |
|
Polygon | Represents polygon data. The outer boundary of a polygon is a closed ring, where the start and end points have the same x and y coordinates. Note A face consists of at least three points. |
|
MultiPoint | Represents a collection of zero or more points. | All ticket offices in an amusement park. |
MultiLineString | Represents a collection of zero or more LineStrings. | A street composed of multiple LineStrings. |
MultiPolygon | Represents a collection of zero or more Polygons. | A city composed of multiple counties or districts. Each county or district is a Polygon. |
GeometryCollection | Represents a collection of zero or more Geometry objects. | A collection of various shapes. |
Constructing Geometry types
Constructing a Geometry object from point coordinates
Use the ST_MakePoint spatio-temporal function to construct a Geometry Point object from numeric point coordinate data. You can also use the ST_LineFromMultiPoint spatio-temporal function to construct a Geometry LineString object from numeric point coordinate data. For more information, see Constructors.
Constructing a Geometry object from WKT format
WKT format
WKT is a format defined by the Open Geospatial Consortium (OGC) to describe spatial objects using text. For more information about WKT, see Well-known Text. Lindorm GanosBase supports the WKT format for seven spatial data types (Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection), but does not support WKT information that contains a Spatial Reference Identifier (SRID).
Lindorm GanosBase supports the following WKT data types:
Data type | Syntax | WKT example |
Point |
|
|
LineString |
|
|
Polygon |
|
|
MultiPoint |
|
|
MultiLineString |
|
|
MultiPolygon |
|
|
GeometryCollection | GeometryCollection (Point/LineString/Polygon/MultiPoint/MultiLineString/MultiPolygon) |
|
Construction method
Use the ST_GeomFromText spatio-temporal function to construct a Geometry object from WKT. For more information, see Constructors.
Outputting Geometry types
Outputting a Geometry object as a WKB string
WKB is a format defined by the OGC that uses serialized bytes to represent geometric objects. For more information, see Well-known Binary. Lindorm GanosBase supports the following seven spatial data types represented in WKB: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection.
When you directly output a Geometry type, it is returned as a hexadecimal string that represents the Geometry object in WKB format. For example:
SELECT ST_GeomFromText('POINT(-10.1 3.3)') as p;The following result is returned:
+--------------------------------+
| p |
+--------------------------------+
| 0020000001000010E6C02433333333 |
| 3333400A666666666666 |
+--------------------------------+Outputting a Geometry object as WKT
Use the ST_AsText spatio-temporal function to output a Geometry object in WKT format. For more information, see Output functions.