I have a line shapefile and a polygon shapefile. I would like to add a field to the line shapefile that specifies which polygons each line feature crosses (comma-separated ID's or another field, for example), and another field that is the count of polygons. Doing the inverse for the polygon layer would also be insightful (how many and which lines intersect each polygon).

Is there an easy way of doing this in ArcGIS Desktop?

1 Answer 1


Without seeing your data, the best bet would be to start by performing an intersect between the lines and the polygons.

This is a solution for ArcGIS:

The intersect will keep the attributes of the Line ID and the Polygon ID. You can perform a Dissolve on the resultant intersect file, using the Line ID and the Polygon IDs as the Dissolve fields.

Under the "statistics" option in the dissolve tool, choose the Polygon ID field and COUNT as the statistic. Your resultant Dissolved dataset will contain the Line ID and the Polygon ID it intersects, as well as the number of times this line intersects a Polygon of the same ID.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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