Description Usage Format Note Author(s) Examples
GPS log of a bike tour from Wageningen (the Netherlands) to Münster (Germany). The table contains 3228 records of GPS locations, speed and elevation.
1 |
The data frame contains the following columns:
lon
longitude (x-coordinate)
lat
latitude (y-coordinate)
ele
GPS-estimated elevation in m
speed
GPS-estimated speed in km per hour
time
XML Schema time
The log was produced using the GlobalSat GH-615 GPS watch. The original data log (trackpoints) was first saved to GPX exchange format (https://www.topografix.com/gpx.asp) and then imported to R using the XML package and formatted to a data frame.
Tomislav Hengl
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run: ## load the data:
data(gpxbtour)
library(sp)
## format the time column:
gpxbtour$ctime <- as.POSIXct(gpxbtour$time, format="%Y-%m-%dT%H:%M:%SZ")
coordinates(gpxbtour) <- ~lon+lat
proj4string(gpxbtour) <- CRS("+proj=longlat +datum=WGS84")
## convert to a STTDF class:
library(spacetime)
library(adehabitatLT)
gpx.ltraj <- as.ltraj(coordinates(gpxbtour), gpxbtour$ctime, id = "th")
gpx.st <- as(gpx.ltraj, "STTDF")
## Google maps plot:
library(RgoogleMaps)
llc <- c(mean(gpx.st@sp@bbox[2,]), mean(gpx.st@sp@bbox[1,]))
MyMap <- GetMap.bbox(center=llc, zoom=8, destfile="map.png")
PlotOnStaticMap(MyMap, lat=gpx.st@sp@coords[,2], lon=gpx.st@sp@coords[,1],
FUN=lines, col="black", lwd=4)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.