Greetings.
I have seen a few posts and answers on this topic, but I think the result given might not be really accurate.
Let's say I have rows with different points with Longitude and Latitude, in a MySQL spatial table. I just want to retrieve the distance between them, with a simple SELECT query. I have tried:
GLENGTH(
LINESTRINGFROMWKB(
LINESTRING(
GEOMFROMTEXT(
ASTEXT(
POINTFROMWKB(
POINT( X(user_location) , Y(user_location))))),
GEOMFROMTEXT(
ASTEXT(
POINTFROMWKB(
POINT( $latitude, $longitude )))))))*100
I know its kind of 'ugly', and I'm afraid the result is not given in KiloMeters.
How am I supposed to do this? Many thanks.