mysqldatabasegeospatialrdbmsmysql-spatial

What type of data are returned by the X() and Y() MySql functions that take a point field as parameter


I am not so into database. Into a geospatial query I have something like this:

SELECT X(gps) AS longitude, Y(gps) AS latitude FROM MyTable

Where the gps field hve point as type.

And it returnes value like:

29,3715    -2,1790

My doubt is: what is the exact type of data returned by the previous X() and Y() function?


Solution

  • The documentation of MySQL function X() explains:

    ST_X() and X() are synonyms. For more information, see the description of ST_X().

    X() is deprecated as of MySQL 5.7.6 and will be removed in a future MySQL release.
    Use ST_X() instead.

    The documentation of ST_X() says:

    ST_X(P)

    Returns the X-coordinate value for the Point object p as a double-precision number.