# Computing distances

1694
8
01-02-2017 12:21 PM
New Contributor

I have several thousand real estate transactions for which I have both the buyer's and seller's zip code of origin.  I am trying to get ArcGIS to compute the distance between these zip codes for each observation.  I am not an expert in GIS by any means, and need some help figuring out how to do this.  Thanks.

8 Replies
MVP Esteemed Contributor

You will need a file of the zip code centroid geometry or you will have to geocode your own data

Then you will have to decide if the straight-line distance will suffice or you need a more detailed road distance which would require more time effort and expenditure.

How is your data arranged currently?  is the owner - buyer information already paired in a data set?

New Contributor

Thanks for the quick reply. Yes, the data is paired. So what I have done

is gotten the centroid of both the zip codes in terms of decimal degrees

latitude and longitude. Then used an Excel function to convert the

difference between these two locations. Not the most elegant of solutions,

but it seemed to work.

Andrew Narwold

Professor of Economics

School of Business, University of San Diego

5998 Alcala Park

San Diego, CA 92110

619-260-4875

MVP Esteemed Contributor

If you are using a great circle calculator then you should be fine.  You could compare closely paired values with calculated using measure tools in Google Earth.  Alternately, you could add your excel file to arcmap, using the longitude/latitude coordinates from the seller data as one file,  then the same data for the buyer as another file.  You would then have a visual to check either manually.  You could then set an appropriate projection for your area(s) to calculate planar distances.  But in short... I suspect your approach is the quickest.

Esri Regular Contributor

Dan, take on the challenge of implementing Vincenty inverse distance calculation in Excel, it's 2017!

MVP Esteemed Contributor

grief ... got that stuff somewhere in python... now I will have to look for it

Esri Regular Contributor
MVP Esteemed Contributor

Welll I found it... then I had to clean it up... numpy_samples/vincenty.py at master · Dan-Patterson/numpy_samples · GitHub

Esri Regular Contributor

Wow!  As an aside I'm amazed at the distortion you can get on distances in projections that are not meticulously crafted for the job.  This is on the ellipsoid.