xtractogon {xtractomatic}R Documentation

Extract environmental data in a polygon using ERDDAP.

Description

xtractogon uses the ERD ERDDAP data web service to extact environmental data inside a polygon defined by vectors of latitudes and longitudes

Usage

xtractogon(xpos, ypos, tpos, dtype, verbose = FALSE)

Arguments

xpos

- array giving longitudes (in decimal degrees East, either 0-360 or -180 to 180) of polygon

ypos

- array giving latitudes (in decimal degrees N; -90 to 90)of polygon

tpos

- 2-array of minimum and maximum times as 'YYYY-MM-DD'

dtype

- number or string identfying the ERDDAP parameter to extract

verbose

- logical for verbose download out, default FALSE

Value

structure with data and dimensions

Details

xtractogon extracts the data from the smallest bounding box that contains the polygon, and then uses the function "point.in.polygon" from the "sp" package to mask out the areas outside of the polygon.

Examples

tpos <- c("2014-09-01", "2014-10-01")
xpos <- mbnms$Longitude
ypos <- mbnms$Latitude
sanctchl <- xtractogon(xpos, ypos, tpos, 'erdVH3chlamday')

[Package xtractomatic version 3.3.2 Index]