The maria/5.3-gis tree on Launchpad.
The maria/5.3-gis tree on Launchpad.
Basic information about the existing spatial features can be found here: MySQL manual that applies to MariaDB as to MySQL.
The tree we explain here, Bug #5.3-gis, contains recent code improving the MariaDB's spatial functionality. Below in this text i address just this tree, speaking about the MariaDB.
MySQL operates spatial data based on the OpenGIS standards, particularly Simple Features SQL subset of standards that can be found here: OpenGIS SFS
Initially that was Simple Features SQL 05-134 MariaDB implements a subset of the SQL with Geometry Types environment proposed by OGC. So the SQL environment has been extended with a set of geometry types.
now steps were made towards the newer 06-104r4 standard.
MariaDB supports spatial extensions to operate on spatial features. These features are available for Aria, MyISAM, InnoDB, NDB, and ARCHIVE tables.
For spatial columns, Aria and MyISAM supports both SPATIAL and non-SPATIAL indexes. Other storage engines support non-SPATIAL indexes.
Latest changes in the code aimed to meed OpenGIS requirements. One thing missing in the present versions is that functions checking spatial relations don't consider the actual shape of object, operate on their bounding rectangles only. These functions were left as they are, instead new properly-working function names got the ST_ prefix, in accordance with the last OpenGIS requirements. Also operations over geometry features were added.
The list of new functions:
Spatial operators. They produce new geometries.
ST_UNION(A, B) union of A and B
ST_INTERSECTION(A, B) intersection of A and B
ST_SYMDIFFERENCE(A, B) symdifference, notintersecting parts of A and B
ST_BUFFER(A, radius) returns the shape of the area that lies in 'radius' distance from the shape A.
predicates, return boolean result of the relationship
ST_INTERSECTS(A, B) if A and B have an intersection
ST_CROSSES(A, B) if A and B cross
ST_EQUAL(A, B) if A nad B are equal
ST_WITHIN(A, B) if A lies within B
ST_CONTAINS(A,B) if B lies within A
ST_DISJOINT(A,B) if A and B have no intersection
ST_TOUCHES(A,B) if A touches B
Another update - the required geometry metadata views were added:
GEOMETRY_COLUMS
table describes the available feature tables and their Geometry properties
Fields are: F_TABLE_CATALOG VARCHAR(200) NOT NULL,
F_TABLE_SCHEMA VARCHAR(200) NOT NULL,
F_TABLE_NAME VARCHAR(200) NOT NULL,
F_GEOMETRY_COLUMN VARCHAR(200) NOT NULL,
G_TABLE_CATALOG VARCHAR(200) NOT NULL,
G_TABLE_SCHEMA VARCHAR(200) NOT NULL,
G_TABLE_NAME VARCHAR(200) NOT NULL,
STORAGE_TYPE INTEGER,
GEOMETRY_TYPE INTEGER,
COORD_DIMENSION INTEGER,
MAX_PPR INTEGER,
SRID INTEGER NOT NULL
SPATIAL_REF_SYS
table describes the coordinate system and transformations for Geometry
Fields are:
SRID INTEGER NOT NULL PRIMARY KEY,
AUTH_NAME VARCHAR(200),
AUTH_SRID INTEGER,
SRTEXT TEXT