You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vignettes/gps-tracks.Rmd
+19Lines changed: 19 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -48,9 +48,28 @@ st_layers("trace.gpx")
48
48
```
49
49
50
50
The previous code code chunk downloads the trace from OSM and queries the 'layers' that can be imported (note there are 5, but only 'tracks' and 'track_points' are available).
51
+
The following code chunk imports and plots the 'tracks' layer, which is a MULTILINESTRING geometry in sf, and only 1 row of data:
51
52
52
53
```{r}
53
54
r = st_read("trace.gpx", layer = "tracks")
55
+
class(r)
56
+
st_geometry_type(r)
57
+
nrow(r)
54
58
plot(r$geometry)
55
59
```
56
60
61
+
Other than the geometry, this object has limited information about the route in the fields.
62
+
The richest field is 'Description', which contains the following summary data:
63
+
64
+
```{r, results='asis'}
65
+
class(r$desc)
66
+
as.character(r$desc)
67
+
```
68
+
69
+
The data can also be imported as points, as follows:
0 commit comments