In the post Fastest Way to Find Distance Between Two Lat/Long Points, user Quassnoi provides the following code for calculating the distance between two locations:
SELECT *
FROM table
WHERE MBRContains
(
LineString
(
Point (
@lon + 10 / ( 111.1 / COS(RADIANS(@lat))),
@lat + 10 / 111.1
),
Point (
@lon - 10 / ( 111.1 / COS(RADIANS(@lat))),
@lat - 10 / 111.1
)
),
mypoint
)
In the comments sections, Quassnoi notes mypoint
is the field in the table which stores the coordinates. My question is, when dealing with longitude and latitude, what is mypoint
? What exactly do we need to pass to MBRContains
as the second argument?
My apologies if this is a trivial question. I wanted to ask Quassnoi directly, but I don't have enough reputation points to comment on the post. Thanks in advance!