Skip to content

r.object.spatialautocor

Spatial autocorrelation of raster objects

r.object.spatialautocor [-d] object_map=name variable_map=name method=string [--verbose] [--quiet] [--qq] [--ui]

Example:

r.object.spatialautocor object_map=name variable_map=name method=string

grass.script.run_command("r.object.spatialautocor", object_map, variable_map, method, flags=None, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("r.object.spatialautocor", object_map="name", variable_map="name", method="string")

Parameters

object_map=name [required]
    Raster input map with objects
variable_map=name [required]
    Raster input map with variable
method=string [required]
    Method for spatial autocorrelation
    Allowed values: moran, geary
-d
    Also take into account diagonal neighbors
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

object_map : str, required
    Raster input map with objects
    Used as: input, raster, name
variable_map : str, required
    Raster input map with variable
    Used as: input, raster, name
method : str, required
    Method for spatial autocorrelation
    Allowed values: moran, geary
flags : str, optional
    Allowed values: d
    d
        Also take into account diagonal neighbors
verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

r.object.spatialautocor calculates global spatial autocorrelation of the raster objects in the object_map based on the values in the variable_map. The user can choose between Moran's I or Geary's G indicator using the method parameter.

At this stage, neighborhood is simply defined by an adjancy matrix. The user can choose whether to also accept diagonal neighborhood by setting the -d flag.

NOTES

The module depends on the addon r.neighborhoodmatrix which needs to be installed.

EXAMPLE

Calculate the spatial autocorrelation of altitude in the elevation map using individual patches in the landclass96 (North Carolina sample dataset) as objects:

g.region raster=elevation
r.clump landclass96 output=objects
r.object.spatialautocor ob=objects var=elevation method=moran
r.object.spatialautocor ob=objects var=elevation method=geary

REFERENCES

Moran, P.A.P., 1950. Notes on Continuous Stochastic Phenomena. Biometrika 37, 17-23. https://dx.doi.org/10.2307%2F2332142

Geary, R.C., 1954. The Contiguity Ratio and Statistical Mapping. The Incorporated Statistician 5, 115. https://dx.doi.org/10.2307%2F2986645

SEE ALSO

r.neighborhoodmatrix

AUTHOR

Moritz Lennert

SOURCE CODE

Available at: r.object.spatialautocor source code (history)
Latest change: Thursday Feb 20 13:02:26 2025 in commit 53de819