Using data from Openstreetmap we will map the GR G1 trail (fr) crossing Guadeloupe. We could use {osmdata} (see this post), but in this case it’s easier to just grab a GPX file from Waymarked Trail (see the link in lower right corner).
Driver: GPX
Available layers:
layer_name geometry_type features fields crs_name
1 waypoints Point 0 23 WGS 84
2 routes Line String 0 12 WGS 84
3 tracks Multi Line String 1 12 WGS 84
4 route_points Point 0 25 WGS 84
5 track_points Point 3673 26 WGS 84
gr <-read_sf("https://hiking.waymarkedtrails.org/api/v1/details/relation/10692471/geometry/gpx",layer ="tracks")
# Mapleaflet(gr) |>addPolylines() |>addTiles()
Source Code
---title: "OSM Guadeloupe trail relation"description: "Day 2 of 30DayMapChallenge"author: "Michaël"date: "2023-11-02T18:00:00"date-modified: last-modifiedcategories: - R - 30DayMapChallenge - spatial - OSM - datavisualizationdraft: falsefreeze: trueeditor_options: chunk_output_type: consolechunk_output_type: consoleexecute: eval: true---[![Guadeloupe -- CC-BY-SA by SnippyHolloW](images/5053973427_476dc157aa_c.jpg){fig-alt="A photo of tropical forest in Guadeloupe"}](https://flic.kr/p/8GAWdT)Day 2 of [30DayMapChallenge](https://30daymapchallenge.com/): « Lines » ([previously](/#category=30DayMapChallenge)).Using data from [Openstreetmap](https://www.openstreetmap.org/) we will map the [GR G1 trail](https://fr.wikipedia.org/wiki/Sentier_de_grande_randonn%C3%A9e_G1) (fr) crossing [Guadeloupe](https://en.wikipedia.org/wiki/Guadeloupe). We could use {osmdata} (see [this post](/posts/2022/use_data_from_openstreetmap/)), but in this case it's easier to just grab a GPX file from [Waymarked Trail](https://hiking.waymarkedtrails.org/#route?id=10692471) (see the link in lower right corner).```{r}library(sf)library(tidyverse)library(leaflet)st_layers("https://hiking.waymarkedtrails.org/api/v1/details/relation/10692471/geometry/gpx")gr <-read_sf("https://hiking.waymarkedtrails.org/api/v1/details/relation/10692471/geometry/gpx",layer ="tracks")``````{r}#| label: fig-trail#| fig-cap: GR G1 in Guadeloupe#| fig-alt: A map of the GR G1 trail in Guadeloupe# Mapleaflet(gr) |>addPolylines() |>addTiles()```