Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a shapefile of United States counties. I have two counties that I would like to highlight. I would like to draw a straight line distance between them. By straight line, I mean, if you were to lay down, say, railroad tracks that go straight. I want to know which counties this line would pass through.

For example, suppose that I would like to draw a line between San Diego County, California, and Cook County (containing Chicago), Illinois. I would want to know which counties this line would pass through. For example, I imagine it would include counties in California, possibly Nevada, and so forth until Illinois, and obviously not include counties in states like Texas, Oregon, Florida, or Vermont.

I use ArcGIS and ArcMap 10.1. I would very much appreciate any help that you could provide!

share|improve this question

You could use Select By Location with your counties as your target layer and your line feature as your source layer. Your selection method would be features that intersect the source layer feature.

If you don't already have an existing line shapefile, you can create your own by first creating a new shapefile or featureclass using ArcCatalog, adding it into ArcMap, and then following these guidlines for editing features. Because your straight line is a theoretical line for your analysis, creating it yourself should be ok.

Once you have your line feature and county shapefile, run the select by location as I mentioned above. Once your features are selected, you can right click your county shapefile in the table of contents and choose Data -> Export Data. Make sure that you have the option to export only selected features checked. Your exported shapefile or featureclass will be just the counties that your line intersects.

share|improve this answer
Exactly what is the line feature? Or, how do I generate the line feature? Is that not just the shapefile of the U.S? Or would it be a feature of the US? Or is it something else? Where would I input the US if it is not, or do I never? Also, how do I obtain the results of which counties would contain the line segment? I have tried to do Selection by Location and am not seeing any output or change in the Attributes Tables, and cannot figure out where I have went wrong. – user1690130 Oct 10 '12 at 0:35
I've edited my answer to give you a bit more information. Let me know if this needs more clarification. – egdetti Oct 10 '12 at 1:30
Thank you for editing your answer! However, I have never used ArcCatalog before. Thank goodness I have access to it--I checked after your mentioning it. I have loaded the shapefile. However, I cannot figure out how to make the line. Using your other directions, I think I might be able to do the rest from here after the line is made. Thank you for all of your help and your patience to walk me through the steps. – user1690130 Oct 10 '12 at 2:12
To become familiar with how to create a new shapefile or feature class and edit a line into it you may want to consider running through the Editing Tutorial which can be found here… – PolyGeo Oct 10 '12 at 2:50

Your Answer


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.