I have ~5000 polygons in green (districts).

I have storms that I am interested in as red lines. Each storm has a unique ID.

Looking to add fields to the districts. The fields are 25km, 50km, 100km, 150km, 200km, 250km.

Within these fields I would like to populate the number of storms for each district. So a district may have 1 at 25km but 5 at 200km (the 25km one can go in the 200km one as well).

Would prefer ArcGIS Model Builder solution but open to ArcPY or QGIS / GDAL OGR.

I could buffer the districts as these intervals and then do a unique ID intersect could but I am looking for a more elegant solution in batch.

I realize this may be a form of Generate Near Table but I cannot quite get it to run as described above.

Storms and districts


1 Answer 1


Your first step is, as you've already deduced, Generate Near Table. It is important to unselect closest only or specify closest="ALL" if using a script. Your in features will be your distrcits, to features will be the storm paths. This will give you a table with too much information and needs to be refined and summarized.

IMPORTANT Before running Generate Near Table you must have both datasets projected to a 'good' coordinate system, if it will fit in a UTM zone then use UTM (not sure where you are and how big the data is) otherwise Lamberts Conic or Equal Area projection would perhaps be more suitable.. either way distances must be in metres and the projection should be measureable (unlike Mercator or Geogaphic). Also, less importantly, it would be best if you do this with Geodatabase features and not shapefiles so the FID/OBJECTID values are static (they change in shapefiles, which can lead to errors later).

From the table select the rows for each of the distance units, for this example I will use 25km. If you're scripting you can specify this in the Where Clause of Make Table View, otherwise select by attributes, ensuring only the records where NEAR_DIST < 25000 then using Summary Statistics you can compile that into a table with counts. For the statistics field select NEAR_FID with a statistics type of COUNT and a CASE field of the IN_FID, this will give you a table that has the FID of each from feature and the count of lines...

Now, attribute join the summary table to your source features (districts) and field calculate the COUNT_NEAR_FID into your (presumably existing) 'storms within 25km field'. Remove the join and repeat with appropriate distance units from select by attributes/make table view - you do not need to regenrate the near table.

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.