2

I have several polygon shapefiles of counties in 6 US states. I also have three shapefiles of country-wide "impaired waterways" a line, a polgyon, and a point feature classes.

What I want is a count of the number of the total geometries (ALL of the impaired waterways) that are within each COUNTY.

Is there a way I can do this in a loop or a batch? I can understand some code, but I do not code myself (yet! working on it!), but is there a tool somewhere that I can use to accomplish this goal?

I know I could split each county shapefile into individual shapefiles and then do a select by location on the three impaired waterways layers, and then get three separate totals to add together, but this will be immensely time consuming, as I have 654 total counties, and I would have to do it three times, once for each waterway layer.

2
  • So, do you want all the waterways for each county in its own shapefile? Or is it that you want the County name transferred to the waterways in a single shape file? Is it just the 'count' you're after... there is a simple way. Commented Jun 18, 2015 at 21:23
  • it is just the count! I just want a count of the total impaired waterways (including all three shapefiles: line, point and polygon) in each county.
    – Megan
    Commented Jun 18, 2015 at 21:31

1 Answer 1

1

First step is to transfer your attributes from your counties to your points, lines and polygons. To do this you will need to use an overlay operator like Intersect or Identity (both work roughly the same way but with subtle differences - look at the pictures on the links). I think Intersect will be the best but at least have a look at both.

Points, lines and polygons can't be merged into a single feature class... but their attribute tables can. Use Table Select to export the attribute tables into a dbf or geodatabase table. At this point you can use summary statistics to get the count of each of point, line and poly.

Then merge the tables using merge to get the count of all features, regardless of geometry type.

Now to achieve a count use summary statistics with a statistics field of FID/OBJECTID (depending on whether it's a dbf or geodatabase) statistics type of COUNT and case field of your county name (or county FID if names are not unique)..

You can now join the summary table onto your counties and see the total count of all records within.

3
  • Okay, I think I understand. I am going to combine the county attributes with each of the three geometries separately (using intersect or identity) and then merge and count the features?
    – Megan
    Commented Jun 18, 2015 at 21:51
  • That's correct, because the geometry types are different you can only merge the tables.. note: the only important attributes are FID/OBJECTID and County Name/ID; because the tables might differ slightly in their attribution you could consider making a new table (with only the required attributes) and use append (no test) to import the records into it - but there's more steps so consider that if you're having difficulty with merging the tables. Commented Jun 18, 2015 at 22:24
  • That worked beautifully, thank you for explaining it so clearly!
    – Megan
    Commented Jun 19, 2015 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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