I’m storing lat/long pairs in MySQL as a point using something like:
GeomFromText('POINT(32 -122)')
Given the point, how do i retrieve the individual X/Y coordinates?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Let’s say you store
GeomFromText('POINT(32 -122)')as a column calledMY_POINTin a table calledMY_TABLE.Getting the
Xcoordinate (will return32in this example):Getting the
Ycoordinate (will return-122in this example):Important: Prior to version 5.6, use X() and Y() instead of ST_X() and ST_Y().