I was being lazy.  The trick is the Haversine formula, explained here:
http://code.google.com/apis/maps/articles/phpsqlsearch_v3.html.  All better
now.  Thank you.

Kevin



On Thu, May 27, 2010 at 12:40 PM, Kevin Slack <[email protected]> wrote:

> Yes, I think that was the path of least resistance: a database of postal
> codes and approximate LatLng codes.  Now I've got website code that can
> easily fetch a LatLong code from a Postal Code.  So now what?
>
> 1.   I have a LatLng Coordinate
> 2.   I want to set a maximum distance, say 30 kms
> 3.   I have a database of Addresses with LatLng Coordinates
> 4.   I need to take my Lookup Coordinate and query my database using my
> maximum distance value
> 5.   And collect and map all the results.
>
> 1 is done; and I know how to do #5.  Meanwhile I will continue to poke
> around. Thanks.
>
> On Thu, May 27, 2010 at 10:19 AM, Kevin Slack <[email protected]> wrote:
>
>> Thanks Marc and Esa for your help.  I've already got a perfectly
>> functional database with perfectly functional php lookup queries.  The one
>> in particular that is giving me trouble is Postal Code.  I don't want to get
>> results from my database of  addresses that match the Postal Code and plot
>> the map.  I want to:
>>
>> 1.   Assign approximate coordinates to that postal code; and
>> 2.   Then do a radius result (querying LatLng)
>>
>> I don't know how to do either yet but I assume I can sort out the second
>> part of this.  The first part is giving me the trouble.  I can see that I
>> can use the Geocoder object but I get the result (the approximate LatLng of
>> the Postal Code) as a JavaScript variable. But I think I need to play with
>> that variable as a PHP variable.
>>
>> It occurs to me that it might just be faster to create a lookup table in
>> my database of Postal Codes and Approx LatLng - that way I don't have to
>> worry about Geocoder data and timing my requests and JavaScript Variables.
>> Thanks again.
>>
>> Kevin
>>
>>
>>
>>
>> On Wed, May 26, 2010 at 4:09 PM, Marc Guay <[email protected]> wrote:
>>
>>> >
>>> http://code.google.com/apis/maps/articles/phpsqlgeocode.html#geocodephp-Paul
>>>
>>> I forgot to mention that once you have the LatLong's there is a simple
>>> formula you can use to calculate the distance between two points.
>>>
>>> Marc
>>> MobilizeMe
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Google Maps JavaScript API v3" group.
>>> To post to this group, send email to
>>> [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected]<google-maps-js-api-v3%[email protected]>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>>>
>>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to