MariaDB spatial support
Platform and version scope
DBMS behavior: this page uses the unversioned MariaDB Server reference, checked on 2026-10-11. Those pages do not establish one release range for every feature. No MySQL behavior is imported as MariaDB evidence. Integration records are pinned to Doctrine Spatial 6.0.0; no live server compatibility matrix was verified for this documentation.
Spatial behavior
| Subject | MariaDB behavior and evidence scope |
|---|---|
| Types/geometries | GEOMETRY, Point, LineString, Polygon, their three multi-types and GeometryCollection are listed in Geometry Types. A separate native geography type is not listed there. |
| Dimensions | XY is evidenced by the documented WKB Point layout. XYZ, XYM and XYZM are not assessed: POINT mentions optional Z/M in its summary but documents Point(x,y) syntax; the WKB reference describes type codes 1–7 and X/Y. |
| CRS/SRID | ST_SRID reads an associated integer; the reference says calculations assume Euclidean planar geometry. Assigning 4326 does not establish geodetic distance semantics. ST_SRID |
| Formats | ST_GeomFromText accepts WKT and optional SRID; ST_GeomFromWKB accepts WKB and optional SRID. The latter's example exports through ST_AsBinary. |
| Empty values | Geometry Types demonstrates empty GeometryCollection text. A complete per-type EMPTY matrix is not assessed. |
| Restrictions | The GIS overview distinguishes legacy bounding-rectangle predicates from the newer ST_ shape predicates. Do not treat them as interchangeable. |
The source discrepancy around Z/M is a vendor documentation evidence limit, not a normative interpretation or an authorization to change LongitudeOne. Use a version-specific server check before relying on additional ordinates. Internal binary-layout equivalence with MySQL and universal EWKT/EWKB support are not established by these sources.
Differences from standards
Vendor subset: the listed geometry inventory and WKB description are narrower than the OGC 06-103r4 dimensional/type representation inventory (7.2.2–7.2.5; 8.2.8). This is an evidence-scoped comparison, not a certification of MariaDB conformance or a blanket claim that every unlisted feature is rejected. See the OGC representation reference.
Vendor behavior: SRID metadata with planar calculation and legacy bounding-rectangle predicates remain MariaDB implementation choices. They do not redefine CRS concepts or the OGC predicate requirements.
LongitudeOne integration and support
Every row concerns Doctrine Spatial 6.0.0, MariaDB adapter. Source inspection establishes the SQL adaptation below; vendor version constraints beyond these records and complete function-by-function integration are not assessed.
| Feature | Implementation scope | Status | Limitations | Implementation decision | Extensions | Evidence |
|---|---|---|---|---|---|---|
| XY linear geometry persistence | Doctrine Spatial 6.0.0, MariaDB | Supported | PHP Point, LineString, Polygon and their three multi-types; not all native families. | Write WKT with ST_GeomFromText; read WKB with ST_AsBinary. | None documented. | MariaDB adapter, PHP types |
| Geography model | Doctrine Spatial 6.0.0, MariaDB | Partially supported | The mapping does not create a distinct geography column or geodetic calculations. | Map the generic geography type to GEOMETRY. | None documented. | Adapter |
| Preserving supplied SRID in ordinary persistence | Doctrine Spatial 6.0.0, MariaDB | Unsupported | WKT omits the object's SRID; the generated constructor supplies no SRID, and the declaration ignores the SRID parameter. | An explicit SQL constructor can supply metadata; ordinary persistence does not. | None documented. | Adapter |
| XYZ, XYM, XYZM and GeometryCollection PHP values | Doctrine Spatial 6.0.0, MariaDB | Unsupported | Point exposes only X/Y; no GeometryCollection PHP class. Vendor dimensional ambiguity does not alter this library limit. | Retain released PHP type scope. | None documented. | PHP types, Point |
| Complete EMPTY round trips and raw column binary decoding | Doctrine Spatial 6.0.0, MariaDB | Not assessed | SQL selection uses ST_AsBinary; no universal internal storage layout or EMPTY guarantee follows. | No new compatibility behavior defined. | None documented. | Adapter, PHP types |
Related references
DBMS overview, MySQL differences, geometry families, dimensions, formats, SQL/MM Spatial and Doctrine Spatial 6.x usage.