cartociudad_get_map: Get a Cartociudad Map

View source: R/cartociudad_get_map.R

cartociudad_get_mapR Documentation

Get a Cartociudad Map

Description

Downloads static maps using Cartociudad API. These maps can be then plotted by functions such as ggmap.

Usage

cartociudad_get_map(center, radius, add.censal.section = FALSE,
   add.postcode.area = FALSE, add.cadastral.layer = FALSE,
   height = 800, width = 1200)

Arguments

center

a pair of numbers (latitude and longitude of the center of the map)

radius

approximate map "width" in kilometers

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

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

add.cadastral.layer

whether to add cadastral information

height

map height in pixels

width

map width in pixels

Details

This function, similar to get_googlemap or get_openstreetmap downloads a map from Cartociudad API and creates a ggmap compatible version of it.

Value

An object of class ggmap and raster which can be used within the ggmapframework.

Author(s)

Carlos J. Gil Bellosta

References

http://www.cartociudad.es/recursos/Documentacion_tecnica/CARTOCIUDAD_ServiciosWeb.pdf

Examples

## Not run: 
  soria <- cartociudad_geocode("plaza de san esteban, soria")
  soria_map <- cartociudad_get_map(c(soria$lat, soria$lng), 1)
  ggmap::ggmap(soria_map)

## End(Not run)


rOpenSpain/caRtociudad documentation built on June 9, 2022, 7:38 p.m.