Skip to main content

MariaDB spatial support

View Markdown versionEdit this page on GitHub

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​

SubjectMariaDB behavior and evidence scope
Types/geometriesGEOMETRY, Point, LineString, Polygon, their three multi-types and GeometryCollection are listed in Geometry Types. A separate native geography type is not listed there.
DimensionsXY 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/SRIDST_SRID reads an associated integer; the reference says calculations assume Euclidean planar geometry. Assigning 4326 does not establish geodetic distance semantics. ST_SRID
FormatsST_GeomFromText accepts WKT and optional SRID; ST_GeomFromWKB accepts WKB and optional SRID. The latter's example exports through ST_AsBinary.
Empty valuesGeometry Types demonstrates empty GeometryCollection text. A complete per-type EMPTY matrix is not assessed.
RestrictionsThe 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.

FeatureImplementation scopeStatusLimitationsImplementation decisionExtensionsEvidence
XY linear geometry persistenceDoctrine Spatial 6.0.0, MariaDBSupportedPHP 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 modelDoctrine Spatial 6.0.0, MariaDBPartially supportedThe 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 persistenceDoctrine Spatial 6.0.0, MariaDBUnsupportedWKT 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 valuesDoctrine Spatial 6.0.0, MariaDBUnsupportedPoint 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 decodingDoctrine Spatial 6.0.0, MariaDBNot assessedSQL selection uses ST_AsBinary; no universal internal storage layout or EMPTY guarantee follows.No new compatibility behavior defined.None documented.Adapter, PHP types

DBMS overview, MySQL differences, geometry families, dimensions, formats, SQL/MM Spatial and Doctrine Spatial 6.x usage.