I have a polyline layer has a unique text field that identifies a path. I have made a union with a separate 1km lattice grid. I am needing a way to get a "count" of the number of uniquely identified paths that fall within each 1km grid spacing. Is there a tool in ArcGIS (of note I have an ArcInfo license) to do this?
2 Answers
I would use the Summary Statistics Tool ( in Analysis Tools - Statistics). From here - the statistics field would be the URL field name - with the Statistics Type as COUNT and the add the case field as the Lattice grid ID.
Well, I would personally do this in two steps. I would take your line layer and dissolve based on the unique path ID so you have each unique path as one feature (enable multi-part features if necessary so each path is just one feature in the output line layer). Then, take that output line layer and use the spatial join tool to spatially join it with your grid polygons feature class. You'd use the grid as the target and line as the join feature. You'd want to use JOIN_ONE_TO_ONE for the Join Operation. Then in the field mapping options for the spatial join tool you'd want to use the merge rules (the COUNT rule would probably be what you're wanting) on the line's unique ID or OID field so that the output has the number of lines. Match option and search radius you should be able to leave at default unless you have unique circumstance you're not describing in the question above. The resulting output should be the grid feature class with a "count" attribute giving the number of lines that intersect each polygon. NOTE: using the default Intersect match option on the spatial join tool will double count lines if the same line intersects multiple grids (it'll count the line for all grids it intersects). Hope that helps, if you need clarification on what I mean, let me know.