1

I have a point feature class that I would like to assign a new field based on the neighborhood of a raster layer.

I'd like to count the number of cells within that neighborhood and write that count an attribute field for each point feature.

The points are often close enough to where there will be overlapping neighborhoods.

1
  • Can you define a bit more by saying neighbour?
    – fatih_dur
    Dec 3, 2016 at 1:35

1 Answer 1

1

For sake of argument assume you have a raster with cell values 10, 20 and 30 and may be some nodata values, this is the raster you want to count. So for each point you want to know the number of 10, 20 and 30 values within a neighbourhood? This is what I have understood from your question?

Step 1

Create 3 binary rasters from your source data, where each raster is a value (e.g. 20) converted to 1 and all other values (10, 30) converted to 0. You can do that with the reclassify tool.

Step 2

Run each binary raster through the Focal Statistics tool using the sum option and setting your neighbour shape and size. For example if you neighbourhood was 3x3 and all the cells within that neighbourhood were 1 that would sum up to 9.

Step 3

Use the Extract Values to Points tool to pass the sum to your point dataset. This gives you the count of the number of cells for that particular value.

Repeat this for the 3 binary rasters, you can easily automate this in model builder.

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.