transSampLoc | R Documentation |
transform samppts to raster projection matching coordinate reference system of the simulation landscape.
transSampLoc(
samppts = NULL,
range.epsg = 4326,
raster.proj = "+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=37.5 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"
)
samppts |
a dataframe with 5 cols: pop, abbrev, lat, long, and N |
range.epsg |
epsg number for the projection in which the points are encoded (default 4326 -> wgs84) |
raster.proj |
proj4 string for the underlying raster |
Takes a dataframe of sample locations in a projection given by range.epsg
(for example, range.epsg = 4326
corresponds to WGS84; see https://epsg.io) and reprojects into the projection given in raster.proj
. Depends on the sf
package to make the conversion.
Feature collection with location of sampled populations converted to the coordinate reference system used in the simulation landscape
ashSetupLandscape
, def_grid_pred2
, getpophist2.cells
, https://epsg.io
library(holoSimCell)
rs <- raster::brick(system.file("extdata/rasters/ccsm_160kmExtent_maxent.tif", package = "holoSimCell"))
newrs <- newLandscapeDim(rs,0.45)
samps <- transSampLoc(pts, range.epsg=4326, raster.proj=crs(rs)@projargs)
land <- def_grid_pred2(pred=newrs, samps=samps, raster.proj=crs(rs)@projargs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.