
Flag a column that holds geographic coordinates
Source:R/data_check_helpers.R
data_check_pii_geo.RdA precise coordinate pins a participant to a place, so it is disclosure risk
even when every other column is anonymous. Detected from the column NAME
(word-split, so LocationLatitude and gps_lat are recognised, not only a
bare lat), then confirmed two ways.
Details
Confirmation matters because the name alone is ambiguous: in psychology data
lat is as likely to be latency or a lateralisation index as latitude, and
lon can be a loneliness scale. Two requirements filter those out:
the values must lie inside the coordinate range (+/-90 for a latitude, +/-180 for a longitude), which rejects a latency in milliseconds; and
a matching PARTNER column must exist in the same file – a latitude needs a longitude beside it. A real coordinate is always a pair, whereas a latency, a loneliness score or a Latin-square code never has a
lonsibling. This is what separates them, since the coordinate ranges are so wide that almost any bounded measurement fits inside them.
gps, geolocation and coordinate name a coordinate outright and need no
partner.