A model for counts data on a spatial domain is presented. The counts are assumed to follow the negative binomial distribution, with both the mean and dispersion parameter allowed to vary spatially. The ratio of the mean to the dispersion parameter is estimated via non-parametric penalized likelihood regression, and is equivalent to David and Moore's ecological index of aggregation. The dispersion parameter is assumed to follow a parametric model whose parameters are estimated via minimization of a variant of the well-known generalized approximate cross-validation (GACV) score, which is simultaneously used to estimate the smoothing parameter associated with estimation of the mean to dispersion parameter ratio. The increased flexibility of the model permitted by allowing the dispersion parameter to vary spatially is illustrated through spatial maps of David and Moore's and other indices of aggregation, such as Lloyd's indices of crowding and patchiness, using real and simulated data. Copyright © 2010 John Wiley & Sons, Ltd.