Returns the inherent dimension of the geometry value. Returns 0 for points, 1 for linear geometries, and 2 for surface geometries.
-1
empty geometry
0
geometry with no length or area
1
geometry with no area but nonzero length
2
geometry with nonzero area
SELECT Dimension(GeomFromText('LineString(1 1,2 2)'));
+------------------------------------------------+
| Dimension(GeomFromText('LineString(1 1,2 2)')) |
+------------------------------------------------+
| 1 |
+------------------------------------------------+