Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a sample of the address histories of households.

ID  ZIP1   ZIP2   ZIP3
01  XXXXX  XXXXX  XXXXX
02  XXXXX  XXXXX  XXXXX
03  XXXXX  XXXXX  XXXXX
04  XXXXX  XXXXX  XXXXX
...

It's easy enough for me to find the centroids of the ZIP codes. What I would like to do is link those centroids together to create an image showing household i's path from ZIP1 to ZIP2 to ZIP3.

Does anyone know any tools to make this easy in QGIS (or even better: R)? I have the feeling there must be some tool, but I don't know enough to think of what the name would be.

share|improve this question
    
So basically you want to create polygons from points? –  nickves Mar 28 '13 at 20:52
    
Well, the object would be a polyline. –  gmacfarlane Mar 29 '13 at 14:27

1 Answer 1

First of all you should try to get geographical information for your zip-codes (geocode them). Without any real points you can't construct a polyline so therefore you should start with that.
With the help of R you can easily geocode a lot of addresses using web-services. See a little example here on my blog. Of course you might have to change the code to your needs and possibly also consult other geocoding services.
The resulting data.frame can be converted to a spatial-object (package sp - coordinates(data) = ~x+y) and then be saved to a shapefile (package rgdal - writeOGR(...) ).

As soon as you have your point layer grouped with a ID you can import it into QGIS and use the excellent plugins Points2One or Points to Path.

share|improve this answer
    
I figured a much easier way to get the spatial information would be by linking the ZIP code information to ZCTA TIGER files, which I already have. And my points are already geocoded anyways. The problem is that each point has multiple pairs of coordinates, and I need a way to map the links. Will look at Points to Path. –  gmacfarlane Mar 31 '13 at 1:31
    
The Points to Paths package worked for me. –  gmacfarlane Apr 17 '13 at 14:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.