Skip to content
New issue

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

add zoomin argument to increase map resolution #690

Merged
merged 3 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ jobs:
- name: Install Linux system dependencies
if: runner.os == 'Linux'
run: |
pak::local_system_requirements(execute = TRUE)
pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
pak::pkg_system_requirements("proj4", execute = TRUE) # Using same proj for now...
pak::pkg_system_requirements("hdf5r", execute = TRUE) # Using same hdf5 for now...
pak::pkg_sysreqs("local::.", dependencies = TRUE)$install_script
pak::pkg_sysreqs("rcmdcheck")$install_scripts
pak::pkg_sysreqs("proj4")$install_scripts
pak::pkg_sysreqs("hdf5r")$install_scripts
#pak::local_system_requirements(execute = TRUE)
#pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
#pak::pkg_system_requirements("proj4", execute = TRUE) # Using same proj for now...
#pak::pkg_system_requirements("hdf5r", execute = TRUE) # Using same hdf5 for now...

shell: Rscript {0}
- name: Install dependencies
run: |
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* discard profiles with misspecified altitude bins in `as.vpts()` and `read_vpts()` (#684)

* new argument `zoomin` for function `bioRad::map()` to increase basemap resolution (#689)

# bioRad 0.8.1

## bugfixes
Expand Down
7 changes: 4 additions & 3 deletions R/map.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' Plots a plan position indicator (`ppi`) on a base layer
#'
#' @param x A `ppi` object.
#' @param map Basemap to use, one of `rosm::osm.types()`
#' @param map Basemap to use, one of [rosm::osm.types()]
#' @param param Character. Scan parameter to plot, e.g. `DBZH` or `VRADH`. See
#' [summary.param()] for commonly available parameters.
#' @param alpha Numeric. Transparency of the data, value between 0 and 1.
Expand All @@ -20,6 +20,7 @@
#' @param n_color Numeric. Number of colors (>=1) to use in the palette.
#' @param palette Character vector. Hexadecimal color values defining the plot
#' color scale, e.g. output from [viridisLite::viridis()].
#' @param zoomin Numeric. Maps to [ggspatial::annotation_map_tile()]
#' @param ... Arguments passed to [ggplot2::ggplot()].
#' @importFrom methods as
#' @return A ggplot object
Expand Down Expand Up @@ -81,7 +82,7 @@ map <- function(x, ...) {
#' @export
map.ppi <- function(x, map="cartolight", param, alpha = 0.7, xlim, ylim, zlim = c(-20, 20),
ratio, radar_size = 3, radar_color = "#202020", n_color = 1000,
palette = NA, ...) {
palette = NA, zoomin = -2, ...) {

stopifnot(inherits(x, "ppi"))

Expand Down Expand Up @@ -221,7 +222,7 @@ map.ppi <- function(x, map="cartolight", param, alpha = 0.7, xlim, ylim, zlim =

mymap <- suppressWarnings(
ggplot2::ggplot() +
ggspatial::annotation_map_tile(type = map) +
ggspatial::annotation_map_tile(type = map, zoomin = zoomin) +
ggplot2::geom_raster(data = rdf, ggplot2::aes(x = x, y = y, fill = fill), na.rm = TRUE, interpolate = FALSE) +
ggplot2::scale_fill_identity(na.value = "transparent") +
ggplot2::geom_point(data = radar_df, ggplot2::aes(x = X, y = Y),
Expand Down
5 changes: 4 additions & 1 deletion man/map.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading