jitterSurveyPoints: This is a function to jitter GPS survey points

View source: R/jitterSurveyPoints.R

jitterSurveyPointsR Documentation

This is a function to jitter GPS survey points

Description

Following DHS guidelines, survey GPS locations need to be purposefully displaced (jittered) before disseminating in order to preserve annonymity. Each point is displaced based on its urban/rural definition. All points must stay within the administrative 2 boundaries in which they originate.

Usage

jitterSurveyPoints(inPts, inAdmin, urbanField = "Id", urbanDist = 2000,
  ruralDist = 5000, ruralDistFar = 10000)

Arguments

inPts

SpatialPointsDataFrame containing the points to be jittered.

inAdmin

SpatialPolygonsDataFrame containing administrative boundaries. Jittered points are not allowed to be moved outside their original administrative boundary.

urbanField

string indicating the column that contains a binary indicator that defines urban and rural points. 1 = Rural.

urbanDist

(optional) numeric distance (in metres) to jitter urban points. Default is 2000m.

ruralDist

(optional) numeric distance (in metres) to jitter rural points. Default is 5000m.

ruralDistFar

(optional) numeric distance (in metres) to jitter 1% of rural points. Default is 10000m.

Value

A spatial data frame with randomly jittered coordinates

Examples

# First load the input points. You can use the example data:

data("inPts")

# As you can see this is a shapefile with the following structure:

str(inPts)

# You will also need administrative boundaries
to ensure that the Jittered survey locations remain within administrative units.

data("inAdmin")

# Finally pass on the objects to the jitterSurveyPoints function.

newPts = jitterSurveyPoints(inPts, inAdmin)

BPJandree/GOSTlibs documentation built on Oct. 6, 2022, 2:37 a.m.