R/get_cartociudad_map.R

Defines functions get_cartociudad_map

Documented in get_cartociudad_map

##########################################################################
# @gilbellosta, 2016-03-30
# Gets ggmap compatible maps from Cartociudad
##########################################################################

#' @title Get a Cartociudad Map
#'
#' @description Downloads static maps using Cartociudad API. These maps can be
#'   then plotted by functions such as \code{ggmap}.
#'
#' @details This function, similar to \code{get_googlemap} or
#'   \code{get_openstreetmap} downloads a map from Cartociudad API and creates a
#'   \code{ggmap} compatible version of it.
#'
#' @usage get_cartociudad_map(center, radius, add.censal.section = FALSE,
#'    add.postcode.area = FALSE, add.cadastral.layer = FALSE,
#'    height = 800, width = 1200)
#'
#' @param center a pair of numbers (latitude and longitude of the center of the
#'   map)
#' @param radius approximate map "width" in kilometers
#' @param add.censal.section whether to add the limit of censal sections and
#'   districts to the base map; note that this layer may not be available at low
#'   zoom levels
#' @param add.postcode.area whether to add the limit of postal code areas to
#'   the base map; note that this layer may not be available at low
#'   zoom levels
#' @param add.cadastral.layer whether to add cadastral information
#' @param height map height in pixels
#' @param width map width in pixels
#'
#' @return An object of class \code{ggmap} and \code{raster} which can be used
#'   within the \code{ggmap}framework.
#'
#' @author Carlos J. Gil Bellosta
#'
#' @references
#' \url{http://www.cartociudad.es/recursos/Documentacion_tecnica/CARTOCIUDAD_ServiciosWeb.pdf}
#'
#' @examples
#' \dontrun{
#'   soria <- cartociudad_geocode("plaza de san esteban, soria")
#'   soria_map <- get_cartociudad_map(c(soria$lat, soria$lng), 1)
#'   ggmap::ggmap(soria_map)
#' }
#'
#' @export
#'
get_cartociudad_map <- function(center, radius, add.censal.section = FALSE,
                               add.postcode.area = FALSE,
                               add.cadastral.layer = FALSE,
                               height = 800, width = 1200) {

  .Deprecated("cartociudad_get_map")
  cartociudad_get_map(center, radius, add.censal.section, add.postcode.area, add.cadastral.layer, height, width)
}
cjgb/caRtociudad documentation built on June 2, 2022, 7:15 p.m.