On Mar 26, 1:45 pm, "[email protected]" <[email protected]>
wrote:
> On Mar 26, 10:20 am, pete <[email protected]> wrote:
>
>
>
> > Hello everyone --
>
> > I'm just learning Google Maps.
>
> > In an earlier thread, Rossko wrote:
>
> > > First, find the nearest handful of ATMs using the simple
> > > straight line distance.
> > > The simple maths can deal with hundreds of ATMs
>
> > and so did Mike Williams:
>
> > > So find the straight line distances for all the ATMs, sort
> > > them, and then only request distances for the first five.
>
> > This is exactly my problem: finding the "nearest handful" of ATMs; or
> > "find the straight line distances for all the ATMs."
>
> > Li is dealing with a total of only 20 ATMs, so the solutions you two
> > guys suggest will work absolutely great.
>
> > I hope you folks can help me with this problem, which is the same
> > problem but with a lot more "ATMs:"
>
> > I must find, given an arbitrary base LatLng somewhere in the US,
> > Canada, or Mexico, all postal/zip codes within some small radius --
> > say from five to fifty statute miles.
>
> > Surely the brute-force method (calc d between every pair of postal
> > codes and choose those that fit) can'twork in the world.
>
> > This problem must have been solved already, but I am stymied. Has
> > anyone any insights on this issue?
>
> Look at the store locator tutorial/example:
>
> http://groups.google.com/group/Google-Maps-API/browse_frm/thread/486d...
>
> If you have a database containing a latitude/longitude for each entry,
> you can do a search (in the database) for the points within a given
> distance and return them.
Thanks, Larry. The store locator is very impressive and, as you hint,
exactly appropriate. I'll change my db of ~40,000 zip codes around to
accord with Pamela's code; and I'll run some experiments to see if I
can make response times be reasonable -- several hundred milliseconds
to place the first marker, then several seconds -- fewer than 10, say
-- to collect and plot the other 20 or 30 or so. The asynchronous
character of the interface will make this acceptable to a user, it
looks like to me.
Does that seem to you a right approach?
Thanks again for the guidance and great example.
-- Pete
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---