0

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 for USA, Germany) Anyone know of any? Or a ready to use web service or whatever that allow me go to the beach earlier?

THX.-

Igor Parra
  • 10,214
  • 10
  • 69
  • 101

2 Answers2

1

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.-

Igor Parra
  • 10,214
  • 10
  • 69
  • 101
0

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

Community
  • 1
  • 1
Stofke
  • 2,928
  • 2
  • 21
  • 28
  • Thanks for your reply. Yes, I know what you say. I asked for a database or web service to provide that data (zipcode - longitude - latitude). – Igor Parra Feb 26 '11 at 00:08