Calculate the Standard Deviation Ellipse

Description

This function computes the Standard Deviation Ellipse (SDE) from a set of points. The SDE is a centrographic measure used to characterize the dispersion of point observations along two orthogonal axes. The SDE also captures directional bias in a spatial point pattern, the ellipse will be oriented in the direction of maximum dispersion.

Usage

1
2
calc_sde(id=1, filename="SDE_Output.txt", centre.xy=NULL, calccentre=TRUE, 
weighted=FALSE, weights=NULL, points=activities, verbose=FALSE)

Arguments

id

A unique integer to identify the shape

filename

A string indicating the ASCII textfile where shape coordinates will be written

centre.xy

A vector of length 2, containing the x- and y-coordinates of the SDE centre (Planar Coordinates Only!)

calccentre

Boolean: Set to TRUE if the mean center is to be calculated

weighted

Boolean: Set to TRUE if the weighted mean center is to be computed with weighted coordinates

weights

Weights applied to point observations, number of weights should equal the number of observations

points

A 2-column matrix or data frame containing point coordinates

verbose

Boolean: Set to TRUE if extensive feedback is desired on the standard output

Details

Use the sdeloc (coordinates) and sdeatt(attributes) to produce shapefiles using the convert.to.shapefile and write.shapefile from the shapefiles library

Value

The returned result is a list:

id

Identifier for the SDE shape - it should be unique

calccentre

Boolean: TRUE if mean centre is computed

weighted

Boolean: TRUE if the weighted mean centre is to be used instead

CENTRE.x

X-coordinate of the centre

CENTRE.y

Y-coordinate of the centre

Sigma.x

Half-length of axis along x-axis

Sigma.y

Half-length of axis along y-axis

Major

String indicating which axis is the major elliptical axis

Minor

String indicating which axis is the minor elliptical axis

Theta

Rotation angle in degrees

Eccentricity

A measure of eccentricity (i.e., the flatness of the ellipse)

Area.sde

Area of the SDE

TanTheta

Trigonometric result

SinTheta

Trigonometric result

CosTheta

Trigonometric result

SinThetaCosTheta

Trigonometric result

Sin2Theta

Trigonometric result

Cos2Theta

Trigonometric result

ThetaCorr

Corrected theta angle for rotation of major axis from north

Note

Results are stored in the r.SDE object (required for plot_sde). This function can be used on its own (once) or repetitively in a loop to process grouped point data stored in a larger table. When used repetitively, be sure to increment the id parameter to ensure that each SDE has a unique identifier. The output ASCII coordinate file can be further processed using the shapefiles package to generate an ESRI Shapefile for SDE polygons..

Author(s)

Randy Bui, Ron N. Buliung, Tarmo K. Remmel

References

See chapter 4 of the documentation manual for CrimeStat at http://www.icpsr.umich.edu/CRIMESTAT/ and Ebdon, D. 1987. Statistics in geography. 2nd edition. New York, NY Basil Blackwell Ltd. 232 p.

See Also

plot_sde, calc_sdd, calc_box,gridpts

Examples

1
2
3
4
5
6
7
8
9
## SDE example
calc_sde(id=1, filename="SDE_Output.txt", centre.xy=NULL, calccentre=TRUE, 
weighted=FALSE, weights=NULL, points=activities, verbose=FALSE)

## plot_sde by default takes as input the result produced from the calc_sde, read from the current workspace. 

## SDE to shapefile example (exclude the comments below to run script)
## shp <- convert.to.shapefile(sdeloc,sdeatt,"id",5)
## write.shapefile(shp, "SDE_Shape", arcgis=T)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.