getPolygon: Get the boundary box for a given dataset retrieved in a query

Description Usage Arguments Details Value Examples

Description

getPolygon creates an SpatialPolygonsDataFrame object that displays the boundary box for a given dataset based on info from the *area* column in the data.frame generated by querySW.

Usage

1
getPolygon(x, index)

Arguments

x

data.frame returned by the querySW function

index

numeric; index (row) of a record in x. See Details section

Details

getPolygon creates an SpatialPolygonsDataFrame object that displays the boundary box for a given dataset (corresponding to row index) based on info from the *area* column in the data.frame generated by querySW.

Value

a SpatialPolygonsDataFrame object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
api_key <- "your_personal_alphanumeric_api_key"

# Set the SkyWatchr.apikey option 
options(SkyWatchr.apikey = api_key)

res <- querySW(time_period = "2015-8", longitude_latitude = "-71.1043443,-42.3150676")
sppolygon <- getPolygon(res, 61)

library(mapview)
mapView(sppolygon)

## End(Not run)

amsantac/SkyWatchr documentation built on May 12, 2019, 2:37 a.m.