📜  mysql 8 geo to json - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:10.489000             🧑  作者: Mango

代码示例1
// second argument is max decimal degits
mysql> SELECT ST_AsGeoJSON(ST_GeomFromText('POINT(11.11111 12.22222)'),2);

+-------------------------------------------------------------+
| ST_AsGeoJSON(ST_GeomFromText('POINT(11.11111 12.22222)'),2) |
+-------------------------------------------------------------+
| {"type": "Point", "coordinates": [11.11, 12.22]}            |
+-------------------------------------------------------------+