mysql 8 geo to json

Solutions on MaxInterview for mysql 8 geo to json by the best coders in the world

showing results for - "mysql 8 geo to json"
Elena
08 Jan 2017
1// second argument is max decimal degits
2mysql> SELECT ST_AsGeoJSON(ST_GeomFromText('POINT(11.11111 12.22222)'),2);
3
4+-------------------------------------------------------------+
5| ST_AsGeoJSON(ST_GeomFromText('POINT(11.11111 12.22222)'),2) |
6+-------------------------------------------------------------+
7| {"type": "Point", "coordinates": [11.11, 12.22]}            |
8+-------------------------------------------------------------+