Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to calculate the maximum value in a neighborhood on a raster using the Focal Statistics tool for Spatial Analyst in ArcGIS 10. Using python, I loop though several different radii, with each defining a circular neighborhood, as below:

bandwidth = [1609.344*.125,1609.344*.25,1609.344*.5,1609.344*1,1609.344*2,1609.344*4,1609.344*8,1609.344*16]
for bw in bandwidth:
    kd = "copc_kd_06_" + str(count)
    nhMax = FocalStatistics(kd, NbrCircle(bw, "MAP"), "MAXIMUM", "NODATA")

Note that the "1609.344" is the conversion from meters to miles, so I'm trying to find the neighborhood maximum at 0.125, 0.25, 0.5, 1.0... miles. The problem is that 0.125, 0.25, 0.5, and 2.0 perform well, while 1.0, 4.0, 8.0, and 16.0 produce extremely odd results, as shown below.

Odd results in focal statistics

So, specifically, instead of the circular neighborhoods given in the command, it produces irregular neighborhoods of circles split in three.

Has anyone else seen this, or do you know of a workaround?

share|improve this question
Well, I fixed this problem by converting my "map" radius measurements to "cell" radius measurements. I'm not sure if this problem is general enough to be worth keeping. Advice? Should I delete? –  Patrick Sep 6 '11 at 2:09
add comment

1 Answer

up vote 3 down vote accepted

After much consternation, I solved this problem by converting the neighborhood definition NbrCircle(bw, "MAP") from MAP units to CELL units. In my case it merely required dividing my bw value by 150, the cell size.

This is buggy behavior, and I believe it is related to a known bug.

share|improve this answer
+1 This is a new bug, by the way, introduced into functionality that has existed for a long time. (In earlier versions ArcGIS wasn't even able to do focal calculations in a timely manner with large neighborhoods.) –  whuber Sep 6 '11 at 16:05
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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