I am trying to select a spatial point in SQL so that I can receive the latitude and coordinate of the point in the most simple form possible.
Currently my query looks like this:
SELECT AsText(`coordinates`) FROM table
This returns something along the lines of:
POINT(53.432985 -1.357258)
Are there any other spatial functions that will allow me to return these as two seperate values or at least make them a little easier to perform something like substr on them?
Ideally I'd like it to return two values, a latitude value and a longitude value
This is the geospatial way to retrieve latitude/longitude from a POINT type, assuming that coordinates is stored as a POINT type. X will return the latitude and Y the longitude.
SELECT X(coordinates),Y(coordinates) FROM table
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With