I have a point layer from an aerial photographic survey of a savanna, where each point contains information on the number of trees found within each photo. Some points can have 0 trees, while other points can have 1 or more trees.

points along transect

Points representing photographs along an aerial survey. Each point contains the number of trees within each photograph

I generated a line layer from the points and split it into 1 km features. I wanted to sum the number of trees within each 1 km feature and then display the number of trees/km with a color (through quartiles, Jenks natural breaks, or some other classifier).

enter image description here

A line layer split into 1 km feature, with each feature containing a color indicating the number of trees based on the sum of trees from the points within each 1 km feature

I then wanted to find the average of five of these segments to get the average number of trees/km for 5 km features. Ideally this could be done to find the average number of trees/km for 5, 10, or even 100 km features.

enter image description here

Mean trees/km every 5 km

It seems like a very easy thing to do but I haven't figured out how to do it. I tried creating a raster file that had the sum of trees for 1 km cells, followed by converting that back to points and then converting that back to a raster with the average number of trees/km in 5 km cells. I'm not completely happy with that because the flight path isn't actually straight, so it would result in some raster cells represented by just one point and have extremely high or extremely low number of trees.

Is there a way to get the final result? I didn't want to use Kernal density since I wasn't trying to depict density over a unit area, but rather along a single linear transect. I've been using ArcMap 10.3.1 so far but I'd honestly be happy with using QGIS as well.

1 Answer 1


Once you have your lines layer, perform a spatial join with the points layer.

In ArcMAP and QGIS, you can specify that the join sum field values from multiple features.

In Arc:

  1. Open Spatial Join tool in Analysis toolbox.
  2. Target Features = line_layer
  3. Join Features = points_layer
  4. Join Operation = JOIN_ONE_TO_ONE
  5. In the Field Map, set the Merge Rule for tree_count_field to Sum (see picture below)
  6. Match Option = INTERSECT
  7. Click OK

sum field map

The output should now have a field which sums the point values it intersects. You can now symbolize this layer based on that field as you like.

You can repeat the above steps for your larger segments, but select Mean instead of Sum when performing the join.

  • 1
    Split your line into N segments. Spatial Join trees to segments. Divide segment length by intersect count to get trees/kilometer for any segment. Symbolize treecount using breaks=jenks.
    – Mox
    Mar 2, 2018 at 22:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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