Length of a LineString is sought : GEOMFROMTEXT « Geometric « SQL / MySQL






Length of a LineString is sought

     
mysql>
mysql>
mysql> SET @gc = GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10), POINT(0 100), POINT(40 40), LINESTRING(10 0, 10 10, 20 1
0))');
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> SELECT GLENGTH(GEOMETRYN(@gc, 4));
+----------------------------+
| GLENGTH(GEOMETRYN(@gc, 4)) |
+----------------------------+
|                         20 |
+----------------------------+
1 row in set (0.00 sec)

mysql>
mysql>

   
    
    
    
    
  








Related examples in the same category

1.Using GEOMFROMTEXT function: Creates the internal MySQL GEOMETRY format from a WKT string.
2.Cariable @mp is assigned a Multipoint object with three points