Tell me more ×
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 shapefile of U.S. counties. I also have a line segment. I want to compute the distance of each county to the line. I have also divided the line segment into 10 equal segments. I want to know, for each county, which of the 10 segments is closest?

Is there an easy way to do this in GIS? Right now, I just do the distance separately for each border segment, 10 times. Then in Excel, I determine which segment gives the shortest distance. Identifying, for each county, which of the 10 distances is the miniimum, and then which segment gives that minimum.

I know I can streamline this for the distance part had I not subdivided into the 10 segments. I can just get the shortest distance in general using the whole line. However, I don't know what's a fast way to identify which line segment yields it.

I use ArcGIS 10.1 and ArcMap. I would appreciate any help that you can provide!

share|improve this question

1 Answer

up vote 1 down vote accepted

To do this I would use a Spatial Join with match option of CLOSEST and a distance_field_name.

"The name of a field to be added to the output feature class, which contains the distance between the target feature and the closest join feature. This option is only valid when the spatial relationship (Match Option) CLOSEST is specified. The value of this field is -1 if no feature is matched within a search radius. If no field name is specified, the field will not be added to the output feature class."

share|improve this answer
Thank you for this! I'm confused though. I'm not sure what at all to input into the Spatial Join. There is Target Features. Is that the shapefile with all of the counties? There is Join Features. What goes there? Output Feature Class is the file of the output? For Join Operation, do I do JOIN_ONE_TO_ONE ? What is the Distance_Field_Name ? – user1690130 Oct 15 '12 at 2:06
I think I figured out the first few. Do I do anything for Join Operation? Or, Field Map of Join Features? – user1690130 Oct 15 '12 at 2:13
Should be no need to do anything with Field Mapping. For Join Operation try ONE_TO_ONE first, and see if that provides the solution you seek. – PolyGeo Oct 15 '12 at 2:18
No it's not working. When I type Border as the Distance_field_name, it puts the distance in that cell (which I want), but nowhere does it say which border segment along the line is giving that distance. – user1690130 Oct 15 '12 at 3:25
My quick read of the help suggests that TARGET_FID will hold the identifier of the line segments. – PolyGeo Oct 15 '12 at 4:11
show 5 more comments

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.