cynkra / cynkrablog

Source of the cynkra blog
https://cynkra.com/blog
0 stars 1 forks source link

Uci zurich 2024 #59

Closed DivadNojnarg closed 2 weeks ago

DivadNojnarg commented 2 weeks ago

@christophsax, @jannes-m. Good for review. Since Zurich is welcoming the World road cycling championship in few days, I wanted to mark the occasion.

github-actions[bot] commented 2 weeks ago

Summary

Status Count
🔍 Total 926
✅ Successful 834
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 64
❓ Unknown 0
🚫 Errors 28

Errors per input

Errors in docs/posts/2020-02-09-tempdisagg/index.html

Errors in docs/posts/2018-05-15-tsbox/index.html

Errors in docs/posts/2020-04-02-dm/index.html

Errors in docs/posts/2021-09-18-tsbox-03/index.html

Errors in docs/posts/2022-04-19-seasonal-1.9/index.html

Errors in docs/posts/2021-03-09-seasonal-1.8/index.html

Errors in docs/posts/2019-04-10-tsbox-01/index.html

Errors in docs/posts/2019-08-12-tsbox-02/index.html

DivadNojnarg commented 2 weeks ago

CRAN seems out

jannes-m commented 2 weeks ago

This looks very interesting and great that you analyze your own tracked data. For next time, I would suggest to use the mapview rather than the leaflet package, since it is a bit easier to use. However, this is of course up to personal taste.

christophsax commented 2 weeks ago

Very nice! I cannot comment on the cycling stuff, though.

Fixed some typos.

If you want to merge, it should work and publish, without the link checker to succeed.

DivadNojnarg commented 2 weeks ago

Thanks for the quick review @jannes-m and @christophsax. Very much appreciated. My plan is to follow up after the race with another blog post :)

DivadNojnarg commented 2 weeks ago

@christophsax It seems we can't publish right now. Will check again later.

christophsax commented 2 weeks ago

Sorry, @DivadNojnarg, I was mistaken: We changed the behavior for cynkraweb but not for cynkrablog (https://github.com/cynkra/cynkraweb/commit/ec83260ece9b6b1b9ce18b8c93b4bcee57a2b490). cynkraweb does no longer require the link checker to pass before publish. Perhaps something we could do something like this here as well.

christophsax commented 2 weeks ago

@DivadNojnarg CRAN up again, and it is live. However, the date appears to be wrong.

christophsax commented 2 weeks ago

Also, an authentication error with www.stadiamaps.com

DivadNojnarg commented 2 weeks ago

Fixed thanks!

jannes-m commented 2 weeks ago

FWIW: I would use the sf package for geographic vector data, however, it requires some system dependencies in the background (for how to install see https://github.com/r-spatial/sf). Unfortunately, the reprex package appears to no longer support interactive output. So give it a try yourself if you like.

library("sf")
#> Linking to GEOS 3.13.0, GDAL 3.9.2, PROJ 9.4.1; sf_use_s2() is TRUE
library("mapview")
library("leaflet")

url = "https://zurich2024.com/wp-content/uploads/2024/08/GPX-22-Winterthur-Zurich-1.gpx"
sf::st_layers(url)
#> Driver: GPX 
#> Available layers:
#>     layer_name     geometry_type features fields crs_name
#> 1    waypoints             Point        9     23   WGS 84
#> 2       routes       Line String        1     12   WGS 84
#> 3       tracks Multi Line String        0     12   WGS 84
#> 4 route_points             Point    10687     25   WGS 84
#> 5 track_points             Point        0     26   WGS 84
routes = read_sf(url, layer = "route_points")
waypoints = read_sf(url, "waypoints")

# convert points into a linestring for mapping
l = dplyr::group_by(routes, route_fid) |>
  dplyr::summarize(do_union = FALSE) |>
  st_cast("LINESTRING") 

# alternatively you could also use
# l = read_sf(url, layer = "routes")

# it seems reprex no longer works with interactive output, so pls try it 
# yourself

# mapview(l) +
#  mapview(waypoints)

# leaflet() %>%
#   addTiles() %>%
#   addCircleMarkers(data = st_coordinates(waypoints)) %>%
#   addPolylines(data = st_coordinates(l)[, 1:2])

plot(st_geometry(l))
plot(st_geometry(waypoints), add = TRUE, cex = 3, pch = 16, col = "lightblue")

Created on 2024-09-10 with reprex v2.1.1

Standard output and standard error ``` sh -- nothing to show -- ```