Find locations using zip codes, cities or coordinates
I need to code a finder of cities in a radius of X km. of a given one using a ZIP code or a city. Something like this:
Enter ZIP code or city: [ ] Choose Radius in Km. (10) (20) (30) ------------------------------------------- [ Submit ]
So I need a database relating zip codes, coordinates and city names. (not fo开发者_StackOverflow社区r USA, Germany) Anyone know of any? Or a ready to use web service or whatever that allow me go to the beach earlier?
THX.-
I just found this:
http://api.geonames.org/findNearbyPostalCodes?postalcode=8775&country=CH&radius=10&username=demo
http://www.geonames.org/export/client-libraries.html (several client libraries to request geonames service)
Exactly what I want for Christmas. THX.-
If you can get hold of the coordinates of each location (zipcode - longitude - latitude) you can calculate the distance
You could use http://developer.yahoo.com/geo/geoplanet/guide/index.html to get the longitude and latitude for a place then use the calculation to create the distance.
Calculating distance between zip codes in PHP
精彩评论