Lindorm GanosBase supports eight spatial data types for storing geographic locations, shapes, and spatial relationships. This data is often used in fields such as aviation, navigation, and urban planning. This topic covers the supported types, their Well-known Text (WKT) syntax, and how to construct and output geometry objects.
Spatial data types are available only for LindormTable.
Supported types
Lindorm GanosBase supports the following types, all defined by the Open Geospatial Consortium (OGC):GanosBase
| Type | Description | WKT syntax | Example |
|---|---|---|---|
| Geometry | Parent type of all spatial subtypes. Use a specific subtype instead wherever possible. | — | — |
| Point | A single location defined by a longitude (x) and latitude (y). Three-dimensional (3D) coordinates are stored but converted to 2D for calculations. | POINT(x y) | POINT(-10.1 3.3) · POINT EMPTY |
| LineString | A sequence of two or more connected points. Consecutive vertices can be identical. | LINESTRING(x1 y1, x2 y2, ..., xn yn) | LINESTRING(3 4, 10 50, 20 25) · LINESTRING EMPTY |
| Polygon | A closed ring where the start and end point share the same coordinates. Requires at least three points. The first ring is the outer boundary; additional rings define inner rings. | POLYGON((x1 y1, ..., xn yn), (xa ya, ..., xm ym)) | POLYGON((2 2, 2 8, 8 8, 8 2, 2 2)) · POLYGON((0.5 0.5, 5 0, 5 5, 0 5, 0.5 0.5), (1.5 1, 4 3, 4 1, 1.5 1)) · POLYGON EMPTY |
| MultiPoint | A collection of zero or more points. | MULTIPOINT(x1 y1, x2 y2, ..., xn yn) | MULTIPOINT(10 40, 40 30, 20 20, 30 10) |
| MultiLineString | A collection of zero or more LineStrings. | MULTILINESTRING((x11 y11, ..., x1n y1n), (x21 y21, ..., x2m y2m), ...) | MULTILINESTRING((10 10, 20 20, 10 40), (40 40, 30 30, 40 20, 30 10)) |
| MultiPolygon | A collection of zero or more Polygons. | MULTIPOLYGON(((x11 y11, ..., x1n y1n)), ((x21 y21, ..., x2m y2m)), ...) | MULTIPOLYGON(((30 20, 45 40, 10 40, 30 20)), ((15 5, 40 10, 10 20, 5 10, 15 5))) |
| GeometryCollection | A heterogeneous collection of zero or more geometry objects. | GEOMETRYCOLLECTION(Point, LineString, Polygon, ...) | GEOMETRYCOLLECTION(POINT(40 10), LINESTRING(10 10, 20 20, 10 40), POLYGON((40 40, 20 45, 45 30, 40 40))) |
Choose a column type
The column type you assign to a spatial column determines what data it accepts and whether you can create a spatio-temporal index on it.
| Column type | Accepts | Spatio-temporal index |
|---|---|---|
| Geometry (parent type) | Any subtype — Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, or GeometryCollection | Cannot create a spatio-temporal index for a specific subtype |
| Specific subtype (e.g., Point) | Only that subtype — a Point column rejects LineString data | Supported per subtype |
Use a specific subtype when you know the shape of your data. This lets you create spatio-temporal indexes and enables query optimizations that Geometry columns cannot support.
Use the Geometry parent type only when a column must store mixed subtypes and indexing on a specific subtype is not required.
Use cases
| Type | Example use cases |
|---|---|
| Point | GPS coordinates from vehicles and ships |
| LineString | A street segment; vehicle trajectory over time |
| Polygon | Geofences; land parcels, forests, and administrative regions; shapes such as rectangles and circles |
| MultiPoint | All ticket offices in an amusement park |
| MultiLineString | A street composed of multiple LineStrings |
| MultiPolygon | A city composed of multiple counties or districts, where each is a Polygon |
| GeometryCollection | A mixed set of spatial shapes |
Construct a geometry object
From point coordinates
Use ST_MakePoint to construct a Point object from numeric coordinates, or ST_LineFromMultiPoint to construct a LineString from multiple points. For the full function signatures, see Constructors.
From WKT
WKT is a text format defined by the OGC for representing spatial objects. For the specification, see Well-known Text.
Lindorm GanosBase supports WKT for all seven subtypes (Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection). WKT strings that contain a Spatial Reference Identifier (SRID) are not supported.GanosBase
Use ST_GeomFromText to construct a geometry object from a WKT string:
-- Construct a Point from WKT
SELECT ST_GeomFromText('POINT(-10.1 3.3)') AS p;For all available constructor functions, see Constructors.
Output a geometry object
As WKB (default)
Well-known Binary (WKB) is an OGC-defined binary serialization format for geometry objects. For the specification, see Well-known Binary.
When you select a geometry column directly, the result is a hexadecimal string in WKB format. For example, the query:
SELECT ST_GeomFromText('POINT(-10.1 3.3)') AS p;Returns:
+--------------------------------+
| p |
+--------------------------------+
| 0020000001000010E6C02433333333 |
| 3333400A666666666666 |
+--------------------------------+This hex string is the WKB representation of POINT(-10.1 3.3).
As WKT
Use ST_AsText to convert a geometry object back to a readable WKT string. For the full function signature, see Output functions.