Is there an API somewhere that allow to compare one postal code with a list of postal code to find which one is nearest?
We need your help. I have a problem that i need to solve and i haven't found any concrete solutions to this. In ASP.NET MVC we want to implement a specific feature.
This is for a student training course application, we know that a student will do a training course outside and inside a specific town. The student will give out two or three postal code which are friends, familly etc.
What i need to do is to compare one postal code with a list of postal code to find which one is nearest.
The list of postal code are the emplacement where the student will do the training course.
For this task, its obvious that i need an API or some WebService. Its also obvious that this task will require high trafic if we cannot pass a list of postal code rather than one postal code.
We know that google might have somet开发者_如何学编程hing to do that but it only accept one postal code which isnt what we are looking for.
So is there an API somewhere, a way or whatever that allow to compare one postal code with a list of postal code to find which one is nearest ? Any ideas ?
Thanks.
Edit #1: Please note that im looking for a way to pass a list of postal code to one postal code. The list may be very big and may need to compare with another list.
http://briancray.com/2009/04/01/how-to-calculate-the-distance-between-two-addresses-with-javascript-and-google-maps-api/
We are currently using the Microsoft MapPoint 2010 API to find the distance and it is working in early testing (for Great Britain)
There still doesn't seem to be any web services that support high volumes of lookups well
An alternative solution would be to buy the Cameo data - this has every postcode in the UK with a grid reference, you can just use a bit of pythagoras to calculate the distances between postcodes.
If you are looking at batch processing postal codes as a requirement for your application, the suggested path will be to either purchase a commercial product which will be a combination of a library and a database. You would have to ensure that the product is meant for batch processing applications though i.e. if you are looking to scale up this would be critical. Otherwise you can invest in a home grown solution by calculating the distances using the latitudes and the longitudes (example):
www.movable-type.co.uk/scripts/latlong.html
Hope you resolve your issue soon, good luck.
Update: Check out http://www.geonames.org/
精彩评论