|
Well it all depends on what you are trying to do and what a resource
code is, my recomendation is to get the long/lat for the zip codes and
build a radius search using the following query: replace the follwing fields with value: [origin-lat] [origin-long] [dest-lat] [dest-long] [radius] SELECT distinct zipcode, ROUND((ACOS((SIN([origin-lat]/57.2958) * SIN([dest-latitude]/57.2958)) + (COS([origin-lat]/57.2958) * COS([dest-lat]/57.2958) * COS([dest-long]/57.2958 - [origin-long]/57.2958)))) * 3963, 3) AS distance FROM zipcodes WHERE (latitude >= [origin-lat] - ([radius]/111)) AND (latitude <= [origin-lat] + ([radius]/111)) AND (longitude >= [origin-long] - ([radius]/111)) AND (longitude <= [origin-long] + ([radius]/111)) ORDER BY distance Aaron Deutsch wrote: sent on behalf of a co-worker.... |
_______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php
