Geometry Types
Create spatial columns for geometry types in MariaDB, supported on MyISAM, InnoDB, and ARCHIVE tables.
Description
MariaDB provides a standard way of creating spatial columns for geometry types, for example, with CREATE TABLE or ALTER TABLE. Spatial columns are supported for MyISAM, InnoDB and ARCHIVE tables. See also SPATIAL INDEX.
The basic geometry type is GEOMETRY, but the type can be more specific. The following types are supported:
GEOMETRY
Examples
Note: For clarity, only one type is listed per table in the examples below, but a table row can contain multiple types.
CREATE TABLE object (shapeA POLYGON, shapeB LINESTRING);INSERT INTO geometry_example VALUES
(Point(0, 0)),
(ST_PolygonFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))')),
(ST_LineFromText('LINESTRING(0 0, 1 1, 2 2)')),
(ST_MultiLineStringFromText(
'MULTILINESTRING((0 1, 0 2, 0 3),
(1 0, 2 0, 3 0))')),
(ST_MultiPointFromText('MULTIPOINT(0 0, 1 1, 0 1, 1 0)')),
(ST_MultiPolygonFromText(
'MULTIPOLYGON(((0 40, 0 20, 6 30, 12 20, 12 40, 0 40),
(15 40, 15 20, 25 20, 30 25, 30 35, 25 40, 15 40)))'));POINT
LINESTRING
POLYGON
MULTIPOINT
MULTILINESTRING
MULTIPOLYGON
GEOMETRYCOLLECTION
GEOMETRY
This page is licensed: GPLv2, originally from fill_help_tables.sql
Last updated
Was this helpful?

