Calculation of the length of a route. : Length « Geometric « SQL / MySQL






Calculation of the length of a route.

     
mysql>
mysql>
mysql> SET @ls = GEOMFROMTEXT('LINESTRING(2 2, 9 0, 9 9)');
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> SELECT GLENGTH(@ls);
+------------------+
| GLENGTH(@ls)     |
+------------------+
| 16.2801098892805 |
+------------------+
1 row in set (0.00 sec)

mysql>

   
    
    
    
    
  








Related examples in the same category

1.Query the length of the lines
2.Get the Total length