Counting and storing events contained within polygon using ArcPy?

المشرف العام

Administrator
طاقم الإدارة
I have a fairly large project and I would like to automate some tasks using Python. Problem is, I don’t have any experience with Python for ArcGIS. And I rarely use ArcGIS until something big like this comes up, and usually I am under some time constraint (smh) I am looking for some guidance (such as python syntax to use, methodology, etc.) to help me achieve the following, using the screenshots as a reference…

  1. The red dots denote multiple events that overlap each other (contain multiple records) that fall within the polygon buffer points (labeled A and B, respectively):
  2. The events are part of a shapefile specific to a road corridor, so that each corridor shapefile may contain several event points, representing motor vehicle crashes at an intersection. Each event contains a field “YEAR” that has either 2007, 2008, 2009, or 2010 in the field.:
  3. The polygon buffer shapefiles have a separate field for each year listed above. Most corridors have about 6-10 rows, representing checkpoints along the corridor.
What I wish to accomplish is to:

  1. Count all the events that fall within in the polygon points.
  2. Populate the polygon fields for each year with the correspondingcounts of the “YEAR” field in the event shapefiles to the “CNT_20XX”fields in the polygon shapefiles
  3. Example: Polygon A has a totalof 10 events within it. The counts for each year are 2007= 3, 2008=1, 2009= 2, 2010= 4; so the Polygon for point A would have itscorresponding “CNT_20XX” fields populated with the sum of the countsfor each year in the events shapefile.
So...can this be accomplished in python? Is there a non-python way to accomplish the same thing? I have 16 corridors.



أكثر...
 
أعلى