Description Usage Arguments Details Value Note Examples
Find the nearest-neighbour coordinates of x
in the coordinate arrays of coords
.
1 2 3 4 5 6 7 8 9 10 11 12 13 | romsmap(x, ...)
## S3 method for class 'SpatialPolygonsDataFrame'
romsmap(x, coords, crop = FALSE,
lonlat = TRUE, ...)
## S3 method for class 'SpatialLinesDataFrame'
romsmap(x, coords, crop = FALSE,
lonlat = TRUE, ...)
## S3 method for class 'SpatialPointsDataFrame'
romsmap(x, coords, crop = FALSE,
lonlat = TRUE, ...)
|
x |
object to transform to the grid space, e.g. a |
... |
unused |
coords |
romscoords RasterStack |
crop |
logical, if |
lonlat |
logical, if |
The input coords
is a assumed to be a 2-layer RasterStack or RasterBrick and
using nabor::knn
the nearest matching position of the coordinates of x
is found in the grid space of coords
. The
motivating use-case is the curvilinear longitude and latitude arrays of ROMS model output.
No account is made for the details of a ROMS cell, though this may be included in future. We tested only with the "lon_u" and "lat_u" arrays.
input object with coordinates transformed to space of the coords
Do not use this for extraction purposes without checking the output, this is best used for exploration
and visualization. Re-mapping ROMS data is better done by looking up the coords_points
within spatial objects,
and transferring via the grid index.
1 2 3 | ant_ice_coords <- romsmap(antarctica, ice_coords)
plot(ice_fake, main = "sea ice in pure grid space")
plot(ant_ice_coords, add = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.