开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜