Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calculate distance between 2 post code

 
jim li
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

guys i am trying to create a application web allows to calculate the distance between 2 post code. how can i do it. please give me some hit
 
Hauke Ingmar Schmidt
Rancher
Posts: 436
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What distance? Air line? Or something like finding a route for some sort of transport?

Air line is a two step process: Find the geo coordinates for the address (geocoding) and calculate the great circle distance. For route planning it depends if the service you use does this for you.

That said: Look into e.g. Google Maps Api. They have a geocoding API... and methods for getting the distance, even with nice map displays, so you don't need to do any manual calculation. But there are other vendors, if the Google API restrictions are too much for you.
 
jim li
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
by walking or driving distance...

but i do not need that much details, all i need is how many kilometers between 2 post code, (this will be only used in canada)
 
Hauke Ingmar Schmidt
Rancher
Posts: 436
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Walking or driving can give vastly different results (think pedestrian bridges). Google Maps API will be all you need, I think.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post codes are not points, but areas. The "difference" between random points in two postcodes can be about zero (if they adjoin) or many miles. So what is your definition of "distance"?
 
Paul Clapham
Sheriff
Pie
Posts: 20769
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Canada a postal code is a very small area, unlike the US zip code. For example the postal code where I live consists of about 15 houses on one side of a city block. So in most cases the "location" of a postal code is quite precise.
 
ken jun
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hauke Ingmar Schmidt wrote:Walking or driving can give vastly different results (think pedestrian bridges). Google Maps API will be all you need, I think.


could you tell me more about Google Maps API? or could you give me a website? thank you
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
google maps api
 
ken jun
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:google maps api


thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic