File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes calculate distance between 2 post code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "calculate distance between 2 post code" Watch "calculate distance between 2 post code" New topic
Author

calculate distance between 2 post code

jim li
Ranch Hand

Joined: May 20, 2008
Posts: 180
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

Joined: Nov 18, 2008
Posts: 371
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

Joined: May 20, 2008
Posts: 180
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

Joined: Nov 18, 2008
Posts: 371
Walking or driving can give vastly different results (think pedestrian bridges). Google Maps API will be all you need, I think.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
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"?


Ping & DNS - updated with new look and Ping home screen widget
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18125
    
    8

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

Joined: Apr 23, 2010
Posts: 46
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

Joined: Oct 27, 2005
Posts: 19543
    
  16

google maps api


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
ken jun
Ranch Hand

Joined: Apr 23, 2010
Posts: 46
Rob Spoor wrote:google maps api


thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: calculate distance between 2 post code
 
Similar Threads
Distance between two Airports
A Star Algorithm on google map
Measure distance between two cities ?
Algorithm to find Nodes having largest distance in Binary tree.
how to use distanceBetween built in methog