[GIS] How to all polylines within a polygon be selected and then operated on to determine the average value from an attribute field

arcgis-10.0intersection

I have two files illustrated wonderfully below: 1) Polyline (shown in red), 2) Polygon (shown in black).

The polyline file contains a numeric attribute (elevation in meters).
Grid Count

I would like to select all polylines that are contained within (and intersect) each polygon grid cell. I would then like to count the number of lines inside each cell, sum their elevations (from the attribute table) and report the average elevation of polylines in each cell. The lines can belong to more than one cell.

Aside from doing this manually using selections, which is not possible given the number of cells/lines, how can I accomplish this task?

In the end I would simply like a list of the average elevations for each grid cell – ideally this could all be done in the GIS, but exporting to a spreadsheet and performing the final calculations (average) is workable.

Best Answer

I doubt the null output could be due to this

Instead of using the SpatialJoin Geoprocessing too, you could try the below method.

Right Click your Polygon Layer > Joins and Relates - Select Join.

give the parameters as per the picture below. The counts and the sum of each attributes will be updated for each polygon grid

enter image description here