This is a mySQL approach. It assumes you know all of the
coordinates nearby and are in your data..
I've done something similar with a selling houses app, ordering by distance
from a given point, place this in your SQL select statement:
((ACOS(SIN(' . **$search_location['lat']** . ' * PI() / 180) *
SIN(**map_lat** * PI() / 180) + COS(' . **$search_location['lat']** .
' * PI() / 180) * COS(**map_lat** * PI() / 180) * COS((' .
**$search_location['lng']** . ' - **map_lng**) * PI() / 180)) * 180 /
PI()) * 60 * 1.1515) AS "distance"
Replace $search_location with your relevant lat/lng values and the
map_lat/map_lng values are the SQL columns which contain the lat/lng
values. You can then order the results by distance and either use a where
or having clause to filter our properties within a 50km range.
On Wed, Mar 15, 2017 at 12:23 AM, <
[email protected]> wrote:
> (to be done in VFP9SP2 existing app)
>
> Customer need: to grab/query towns near a certain zip code or city name,
> akin to like when you use an app where you're looking for a car and say
> "show me matches within 50 miles." I'm thinking latitude/longitude and
> google somehow, but I thought I'd poll the community to see what you'd
> recommend.
>
> Thanks!
> --Mike
>
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/CAJidMYJUG3=+fHK=pgobe3mv+dnsqbpe60born75zevropx...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.