Personal tools
You are here: Home Users Geoffrey Morris GIS

GIS

GPS

Downloading data from Garmin Etrex Vista

Resources

# Degree-minutes-seconds (DMS) to decimal degrees (DD)
d <- read.table("/Users/geoff/Desktop/data/fermi_stake_coord.txt",sep=c("\t","\'"),quote="",stringsAsFactors=F)
dms_to_dd <- function(x) {sum(as.numeric(sub("\"","",unlist(strsplit(unlist(strsplit(x,"\' ")),"\xa1 "))))/c(1,60,3600))}
for(i in 1:nrow(d)) {d[i,2] <- dms_to_dd(d[i,2]); d[i,3] <- dms_to_dd(d[i,3])}
d  <- d[-1,] # remove header row
names(d) <- c("stake","lat", "long")
d$long <- -as.numeric(d$long) # Longitudes are West (-)
write.table(d, "/Users/geoff/Desktop/data/fermi_stake_coord_DD.txt", sep="\t", quote=F, row.names=F)

Inserting Google Maps for a GPS coordinate

 

View Larger Map
Document Actions