Title: | Get Maps from Bing Maps Static Map API |
---|---|
Description: | Get static maps using aerial, bird's eye and other imagery from Bing Maps. |
Authors: | Eli Pousson [aut, cre, cph] |
Maintainer: | Eli Pousson <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0.9000 |
Built: | 2024-11-17 05:10:28 UTC |
Source: | https://github.com/elipousson/bingmapr |
This function will add your CENSUS API key to your .Renviron file so it can
be called securely without being stored in your code. After you have
installed your key, it can be called any time with get_bing_maps_api_key()
.
bing_maps_api_key( key, overwrite = FALSE, install = FALSE, default = "BING_MAPS_API_KEY" ) get_bing_maps_api_key( key = NULL, default = "BING_MAPS_API_KEY", call = caller_env() )
bing_maps_api_key( key, overwrite = FALSE, install = FALSE, default = "BING_MAPS_API_KEY" ) get_bing_maps_api_key( key = NULL, default = "BING_MAPS_API_KEY", call = caller_env() )
key |
The API key provided to you from the Bing Maps Dev Center formatted in quotes. A key can be acquired at https://www.bingmapsportal.com/ |
overwrite |
If this is set to |
install |
if |
See the documentation on Bing Static Maps for reference: https://docs.microsoft.com/en-us/bingmaps/rest-services/imagery/get-a-static-map
req_bingmapr( location = NULL, query = NULL, imagery = "BirdsEye", width = 600, height = 400, mapsize = NULL, zoom = 18, orientation = 0, nudge = NULL, key = Sys.getenv("BING_MAPS_API_KEY"), check = FALSE, .perform = TRUE, ... ) get_request_url(...) get_map_image( location = NULL, query = NULL, imagery = "BirdsEye", width = 600, height = 400, mapsize = NULL, zoom = 18, orientation = 0, nudge = NULL, key = Sys.getenv("BING_MAPS_API_KEY"), check = TRUE, strip = TRUE ) get_map_meta( location = NULL, query = NULL, imagery = "BirdsEye", width = 600, height = 400, mapsize = NULL, zoom = 18, orientation = 0, nudge = NULL, key = Sys.getenv("BING_MAPS_API_KEY"), bbox = FALSE )
req_bingmapr( location = NULL, query = NULL, imagery = "BirdsEye", width = 600, height = 400, mapsize = NULL, zoom = 18, orientation = 0, nudge = NULL, key = Sys.getenv("BING_MAPS_API_KEY"), check = FALSE, .perform = TRUE, ... ) get_request_url(...) get_map_image( location = NULL, query = NULL, imagery = "BirdsEye", width = 600, height = 400, mapsize = NULL, zoom = 18, orientation = 0, nudge = NULL, key = Sys.getenv("BING_MAPS_API_KEY"), check = TRUE, strip = TRUE ) get_map_meta( location = NULL, query = NULL, imagery = "BirdsEye", width = 600, height = 400, mapsize = NULL, zoom = 18, orientation = 0, nudge = NULL, key = Sys.getenv("BING_MAPS_API_KEY"), bbox = FALSE )
location |
A |
query |
String with query for location. query is ignored if a location
is provided. Defaults to |
imagery |
String with imagery type, Default: 'BirdsEye' Supported values include:
|
width , height , mapsize
|
Width and height in pixels or use mapsize to
provide a vector of c(width, height). If mapsize is provided, width and
height are ignored. Default: 600px width, 400px height, mapsize is |
zoom |
Numeric vector between 0 and 20 for imagery other than Bird's Eye maps or 18 to 22 for Bird's Eye maps. Default: 18 |
orientation |
Orientation as a character string ("N", "E", "S", "W") or length 1 numeric vector (0,90,180,270). Other numeric orientations (from -360 to 720) are matched to the closest value, e.g. 35 to 0 or 75 to 90. Default: 0 |
nudge |
Numeric vector in the format, |
key |
Bing Maps API Key, Default: |
check |
If |
.perform |
If |
... |
Additional parameters passed to |
strip |
drop image comments and metadata |
bbox |
If |
Get API key from https://www.bingmapsportal.com/
get_request_url returns the request URL for the Static Map API
get_map_image returns an image from magick::image_read
get_map_meta returns the JSON with the map metadata or a bbox for the map area
Wrapper for magick::image_ggplot()
where all ... parameters are passed to
get_map_image()
.
bingmap_image_ggplot(..., interpolate = FALSE)
bingmap_image_ggplot(..., interpolate = FALSE)
... |
Arguments passed on to
|
interpolate |
passed to ggplot2::annotation_raster |