[R] GIS Help: distance calculation based on ZIP Code

Mike Marchywka marchywka at hotmail.com
Wed Dec 8 18:19:29 CET 2010

> From: ggrothendieck at gmail.com
> Date: Wed, 8 Dec 2010 10:50:40 -0500
> To: lihawaii at gmail.com
> CC: r-help at r-project.org
> Subject: Re: [R] GIS Help: distance calculation based on ZIP Code
> On Wed, Dec 8, 2010 at 10:41 AM, XINLI LI  wrote:
> > Dear R Group Users:
> >
> >    If there is a resource or easy way to calculate the distance
> > between zipcodes, for example, if I have the zipcode for 200 patients,
> > and the zipcode of a hospital, how to calculate the travel distance of
> > these individual patient to the hospital based on the zipcode. Your
> > input will be greatly appreciated.
> >
> Try the R-Sig-Geo list.

Data sources do come up here a bit so I will comment that you can
get line-oriented lists of post office locations and more from the
census. The TIGER files would let you find streets etc but are probably
too big for hosting yourself. IIRC, I had to cobble together the zipcode
locations but the data is available. Probably you need more resolution and
other things like traffic data to make a routing decision but I would mention
the landmarks DB probably does have hospitals listed. Also, distances are short
enough that "as the crow flies" you could probably linearize and use scaled
x*x+y*y instead of the spherical stuff. 

I may have put it up here along with other illustrations of things
you can do with public data,


( I would caution this site is not exactly professional but it
may be informative, I am using it for idea testing etc ) 

> --
> Statistics & Software Consulting
> GKX Group, GKX Associates Inc.
> tel: 1-877-GKX-GROUP
> email: ggrothendieck at gmail.com
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list