We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here's an example illustrating how to generate a topology map showing the 300' and the 600' windsocks on Ed Levin using R:
library(leaflet) m <- leaflet() m <- m |> addTiles(urlTemplate = "https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png") m <- m |> setView(lat = 37.4611, lng = -121.8625, zoom = 17) ## 300' windsock m <- m |> addMarkers(lat = 37.4611738, lng = -121.8646301, label = "300ft windsock", labelOptions = labelOptions(noHide = TRUE)) ## 600' windsock m <- m |> addMarkers(lat = 37.4612652, lng = -121.8604359, label = "600ft windsock", labelOptions = labelOptions(noHide = TRUE)) ## Open (sic!) interactive leaflet map in web browser print(m)
To save the same view as a static PNG file, use:
mapview::mapshot2(m, file = "edlevin.png")
This produces:
Assuming modern version of R, install packages using:
$ R ... > install.packages(c("mapview", "webshot2"))
The text was updated successfully, but these errors were encountered:
Here's how to pull free-flying and windsock information from OpenStreetMap and generate an standalone, interactive map;
library(osmdata) library(leaflet) ## https://fontawesome.com/search?o=r&m=free icons <- list( windsock = awesomeIcons(icon = "flag", markerColor = "gray", iconColor = "white"), launch = awesomeIcons(icon = "play", markerColor = "green", iconColor = "white"), lz = awesomeIcons(icon = "stop", markerColor = "red", iconColor = "white"), training = awesomeIcons(icon = "play", markerColor = "orange", iconColor = "white"), groundhandling = awesomeIcons(icon = "user", markerColor = "blue", iconColor = "white") ) ## Ed Levin & Mission Area center <- c(lat = 37.465, lng = -121.86) pad <- c(-1, -1, +1, +1) * 1/10 q <- opq(bbox = rep(center[c("lng", "lat")], times = 2) + pad) q <- q |> add_osm_features(features = list( "sport" = "free_flying", "aeroway" = "windsock" )) data <- q |> osmdata_sf() print(data) m <- leaflet(data) m <- m |> addTiles(urlTemplate = "https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png") for (kk in seq_len(nrow(data$osm_points))) { point <- data$osm_points[kk, ] pos <- point$geometry[[1]] names(pos) <- c("lng", "lat") label <- point$name icon <- NULL site <- point[["free_flying:site"]] if (identical(site, "takeoff")) { icon <- icons$launch } else if (identical(site, "landing")) { icon <- icons$lz } else if (identical(site, "training")) { icon <- icons$training } type <- point[["free_flying:ground_handling"]] if (identical(type, "yes")) { icon <- icons$groundhandling } if (identical(point[["aeroway"]], "windsock")) { icon <- icons$windsock } m <- m |> addAwesomeMarkers(lat = pos["lat"], lng = pos["lng"], label = label, icon = icon) } m <- m |> setView(lat = center["lat"], lng = center["lng"], zoom = 15) print(m)
To save as PNG;
Sorry, something went wrong.
No branches or pull requests
Here's an example illustrating how to generate a topology map showing the 300' and the 600' windsocks on Ed Levin using R:
To save the same view as a static PNG file, use:
This produces:
Installation instructions
Assuming modern version of R, install packages using:
The text was updated successfully, but these errors were encountered: