Title: | Defines a meta class of geographical objects, the 'map' class, and associated tools |
---|---|
Description: | The map class is a collection of map objects ('sp', 'raster', 'sf'), with a number of metadata additions to enable powerful methods, e.g., for leaflet, reproducible GIS etc. |
Authors: | Eliot J B McIntire [aut, cre] , Alex M Chubaty [aut] , Her Majesty the Queen in Right of Canada, as represented by the Minister of Natural Resources Canada [cph] |
Maintainer: | Eliot J B McIntire <[email protected]> |
License: | GPL-3 |
Version: | 0.0.5.9005 |
Built: | 2024-12-25 06:30:43 UTC |
Source: | https://github.com/PredictiveEcology/map |
.rasterToMemory
.rasterToMemory
.rasterToMemory(x, ...)
.rasterToMemory(x, ...)
x |
A |
... |
Additional arguments passed to |
map
objCalculate area of (named) objects the map
obj
## S4 method for signature 'map' area(x)
## S4 method for signature 'map' area(x)
x |
Raster* or SpatialPolygons object |
Other mapMethods:
crs,map-method
,
mapRm()
,
rasterToMatch,map-method
,
rasters()
,
studyArea()
,
studyAreaName()
areaAndPolyValue
Determine the area of each zone in a raster. TODO: improve description
areaAndPolyValue(ras)
areaAndPolyValue(ras)
ras |
A |
list containing: sizeInHa
, the area; and polyID
, the polygon ID.
map
obj metadata tableBuild map
obj metadata table
buildMetadata( metadata, isStudyArea, isRasterToMatch, layerName, obj, columnNameForLabels, objHash, leaflet, envir, ... )
buildMetadata( metadata, isStudyArea, isRasterToMatch, layerName, obj, columnNameForLabels, objHash, leaflet, envir, ... )
metadata |
TODO: description needed |
isStudyArea |
TODO: description needed |
isRasterToMatch |
Logical. Is this(these) layer(s) the |
layerName |
TODO: description needed |
obj |
TODO: description needed |
columnNameForLabels |
TODO: description needed |
objHash |
TODO: description needed |
leaflet |
Logical or Character vector of path(s) to write tiles.
If |
envir |
TODO: description needed |
... |
Additional arguments. |
map
Extract the crs of a map
## S4 method for signature 'map' crs(x, ...)
## S4 method for signature 'map' crs(x, ...)
x |
Raster* or Spatial object |
... |
additional arguments. None implemented |
Other mapMethods:
area,map-method
,
mapRm()
,
rasterToMatch,map-method
,
rasters()
,
studyArea()
,
studyAreaName()
Fasterize with crop & spTransform first
fasterize2(emptyRaster, polygonToFasterize, field)
fasterize2(emptyRaster, polygonToFasterize, field)
emptyRaster |
An empty raster with res, crs, extent all
correct for to pass to |
polygonToFasterize |
passed to |
field |
passed to |
Based on https://johnbaumgartner.wordpress.com/2012/07/26/getting-rasters-into-shape-from-r/.
gdal_polygonizeR( x, outshape = NULL, gdalformat = "ESRI Shapefile", pypath = NULL, readpoly = TRUE, quiet = TRUE )
gdal_polygonizeR( x, outshape = NULL, gdalformat = "ESRI Shapefile", pypath = NULL, readpoly = TRUE, quiet = TRUE )
x |
TODO: description needed |
outshape |
TODO: description needed |
gdalformat |
TODO: description needed |
pypath |
TODO: description needed |
readpoly |
TODO: description needed |
quiet |
TODO: description needed |
map
objExtract leaflet tile paths from a map
obj
leafletTiles(map)
leafletTiles(map)
map |
A |
A vector of paths indicating the relative paths. Any layers that don't have leaflet tiles will return NA.
gdal2tiles
Make tiles (pyramids) using gdal2tiles
makeTiles(tilePath, obj, overwrite = FALSE, ...)
makeTiles(tilePath, obj, overwrite = FALSE, ...)
tilePath |
A director to write tiles |
obj |
A raster objects with or without file-backing |
overwrite |
Logical. If |
... |
Passed to |
map
classContains a common system for organzing vector and raster layers, principally for use with leaflet and shiny.
metadata
data.table
with columns describing metadata of map objects in
maps
slot.
.xData
Named environment of map-type objects (e.g., sf
, Raster*
,
Spatial*
. Each entry may also be simply an environment, which indicates
where to find the object, i.e., via get(layerName, envir = environment)
.
CRS
The common crs of all layers
paths
File paths. A named list of paths. The default is a list of length 2,
dataPath
and tilePath
analyses
A data.table
or data.frame
of the types of analyses to perform.
analysesData
A data.table
or data.frame
of the results of the analyses.
If isStudyArea = TRUE
, then several things will be triggered:
This layer will be added to metadata with studyArea
set to max(studyArea(map)) + 1
.
update CRS slot to be the CRS of the study area.
mapAdd(obj, map, layerName, overwrite = getOption("map.overwrite", FALSE), ...) ## Default S3 method: mapAdd( obj = NULL, map = new("map"), layerName = NULL, overwrite = getOption("map.overwrite"), columnNameForLabels = 1, leaflet = FALSE, isStudyArea = FALSE, isRasterToMatch = FALSE, envir = NULL, useCache = TRUE, useParallel = getOption("map.useParallel", FALSE), ... )
mapAdd(obj, map, layerName, overwrite = getOption("map.overwrite", FALSE), ...) ## Default S3 method: mapAdd( obj = NULL, map = new("map"), layerName = NULL, overwrite = getOption("map.overwrite"), columnNameForLabels = 1, leaflet = FALSE, isStudyArea = FALSE, isRasterToMatch = FALSE, envir = NULL, useCache = TRUE, useParallel = getOption("map.useParallel", FALSE), ... )
obj |
Optional spatial object, currently |
map |
Optional map object. If not provided, then one will be
created. If provided, then the present |
layerName |
Required. A label for this map layer. This can be the same as the object name. |
overwrite |
Logical. If |
... |
Additonal arguments passed to |
columnNameForLabels |
A character string indicating which column to use
for labels. This is currently only used if the object is a |
leaflet |
Logical or Character vector of path(s) to write tiles.
If |
isStudyArea |
Logical. If |
isRasterToMatch |
Logical indicating ... TODO: need description |
envir |
An optional environment. If supplied, then the obj will not be placed "into" the maps slot, rather the environment label will be placed into the maps slot. Upon re |
useCache |
Logical. If |
useParallel |
Logical. If |
## Not run: library(sp) library(raster) library(reproducible) cwd <- getwd() setwd(tempdir()) coords <- structure(c(-122.98, -116.1, -99.2, -106, -122.98, 59.9, 65.73, 63.58, 54.79, 59.9), .Dim = c(5L, 2L)) Sr1 <- Polygon(coords) Srs1 <- Polygons(list(Sr1), "s1") StudyArea <- SpatialPolygons(list(Srs1), 1L) crs(StudyArea) <- paste("+init=epsg:4326 +proj=longlat +datum=WGS84", "+no_defs +ellps=WGS84 +towgs84=0,0,0") StudyArea <- SpatialPolygonsDataFrame(StudyArea, data = data.frame(ID = 1, shinyLabel = "zone2"), match.ID = FALSE) ml <- mapAdd(StudyArea, isStudyArea = TRUE, layerName = "Small Study Area", poly = TRUE, analysisGroup2 = "Small Study Area") if (require("SpaDES.tools", quietly = TRUE)) { options(map.useParallel = FALSE) smallStudyArea <- randomPolygon(studyArea(ml), 1e5) smallStudyArea <- SpatialPolygonsDataFrame(smallStudyArea, data = data.frame(ID = 1, shinyLabel = "zone1"), match.ID = FALSE) ml <- mapAdd(smallStudyArea, ml, isStudyArea = TRUE, filename2 = NULL, analysisGroup2 = "Smaller Study Area", poly = TRUE, layerName = "Smaller Study Area") # adds a second studyArea within 1st rasTemplate <- raster(extent(studyArea(ml)), res = 0.001) tsf <- randomPolygons(rasTemplate, numTypes = 8)*30 crs(tsf) <- crs(ml) vtm <- randomPolygons(tsf, numTypes = 4) levels(vtm) <- data.frame(ID = sort(unique(vtm[])), Factor = c("black spruce", "white spruce", "aspen", "fir")) crs(vtm) <- crs(ml) ml <- mapAdd(tsf, ml, layerName = "tsf1", filename2 = "tsf1.tif", # to postProcess # to map object tsf = "tsf1.tif", # to column in map@metadata analysisGroup1 = "tsf1_vtm1", # this is the label for analysisGroup1 leaflet = TRUE, # to column in map@metadata; used for visualizing in leaflet overwrite = TRUE) ml <- mapAdd(vtm, ml, filename2 = "vtm1.grd", layerName = "vtm1", vtm = "vtm1.grd", analysisGroup1 = "tsf1_vtm1", leaflet = TRUE, overwrite = TRUE) ageClasses <- c("Young", "Immature", "Mature", "Old") ageClassCutOffs <- c(0, 40, 80, 120) # add an analysis -- this will trigger analyses because there are already objects in the map # This will trigger 2 analyses: # LeadingVegTypeByAgeClass on each raster x polygon combo (only 1 currently) # so there is 1 raster group, 2 polygon groups, 1 analyses - Total 2, 2 run now ml <- mapAddAnalysis(ml, functionName ="LeadingVegTypeByAgeClass", ageClasses = ageClasses, ageClassCutOffs = ageClassCutOffs) # add an analysis -- this will trigger analyses because there are already objects in the map # This will trigger 2 more analyses: # largePatches on each raster x polygon combo (only 1 currently) # so there is 1 raster group, 2 polygon groups, 2 analyses - Total 4, only 2 run now ml <- mapAddAnalysis(ml, functionName = "LargePatches", ageClasses = ageClasses, id = "1", labelColumn = "shinyLabel", ageClassCutOffs = ageClassCutOffs) # Add a second polygon, trigger smallStudyArea2 <- randomPolygon(studyArea(ml), 1e5) smallStudyArea2 <- SpatialPolygonsDataFrame(smallStudyArea2, data = data.frame(ID = 1, shinyLabel = "zone1"), match.ID = FALSE) # add a new layer -- this will trigger analyses because there are already analyese in the map # This will trigger 2 more analyses ... largePatches on each *new* raster x polygon combo # (now there are 2) -- so there is 1 raster group, 3 polygon groups, 2 analyses - Total 6 ml <- mapAdd(smallStudyArea2, ml, isStudyArea = FALSE, filename2 = NULL, overwrite = TRUE, analysisGroup2 = "Smaller Study Area 2", poly = TRUE, layerName = "Smaller Study Area 2") # adds a second studyArea within 1st # Add a *different* second polygon, via overwrite. This should trigger new analyses smallStudyArea2 <- randomPolygon(studyArea(ml), 1e5) smallStudyArea2 <- SpatialPolygonsDataFrame(smallStudyArea2, data = data.frame(ID = 1, shinyLabel = "zone1"), match.ID = FALSE) # add a new layer -- this will trigger analyses because there are already analyses in the map # This will trigger 2 more analyses ... largePatches on each *new* raster x polygon combo # (now there are 2) -- so there is 1 raster group, 3 polygon groups, 2 analyses - Total 6 ml <- mapAdd(smallStudyArea2, ml, isStudyArea = FALSE, filename2 = NULL, overwrite = TRUE, analysisGroup2 = "Smaller Study Area 2", poly = TRUE, layerName = "Smaller Study Area 2") # adds a second studyArea within 1st # Add a 2nd pair of rasters rasTemplate <- raster(extent(studyArea(ml)), res = 0.001) tsf2 <- randomPolygons(rasTemplate, numTypes = 8)*30 crs(tsf2) <- crs(ml) vtm2 <- randomPolygons(tsf2, numTypes = 4) levels(vtm2) <- data.frame(ID = sort(unique(vtm2[])), Factor = c("black spruce", "white spruce", "aspen", "fir")) crs(vtm2) <- crs(ml) ml <- mapAdd(tsf2, ml, filename2 = "tsf2.tif", layerName = "tsf2", tsf = "tsf2.tif", analysisGroup1 = "tsf2_vtm2", leaflet = TRUE, overwrite = TRUE) ml <- mapAdd(vtm2, ml, filename2 = "vtm2.grd", layerName = "vtm2", vtm = "vtm2.grd", analysisGroup1 = "tsf2_vtm2", leaflet = TRUE, overwrite = TRUE) # post hoc analysis of data # use or create a specialized function that can handle the analysesData slot ml <- mapAddPostHocAnalysis(map = ml, functionName = "rbindlistAG", postHocAnalysisGroups = "analysisGroup2", postHocAnalyses = "all") } ## cleanup setwd(cwd) unlink(tempdir(), recursive = TRUE) ## End(Not run)
## Not run: library(sp) library(raster) library(reproducible) cwd <- getwd() setwd(tempdir()) coords <- structure(c(-122.98, -116.1, -99.2, -106, -122.98, 59.9, 65.73, 63.58, 54.79, 59.9), .Dim = c(5L, 2L)) Sr1 <- Polygon(coords) Srs1 <- Polygons(list(Sr1), "s1") StudyArea <- SpatialPolygons(list(Srs1), 1L) crs(StudyArea) <- paste("+init=epsg:4326 +proj=longlat +datum=WGS84", "+no_defs +ellps=WGS84 +towgs84=0,0,0") StudyArea <- SpatialPolygonsDataFrame(StudyArea, data = data.frame(ID = 1, shinyLabel = "zone2"), match.ID = FALSE) ml <- mapAdd(StudyArea, isStudyArea = TRUE, layerName = "Small Study Area", poly = TRUE, analysisGroup2 = "Small Study Area") if (require("SpaDES.tools", quietly = TRUE)) { options(map.useParallel = FALSE) smallStudyArea <- randomPolygon(studyArea(ml), 1e5) smallStudyArea <- SpatialPolygonsDataFrame(smallStudyArea, data = data.frame(ID = 1, shinyLabel = "zone1"), match.ID = FALSE) ml <- mapAdd(smallStudyArea, ml, isStudyArea = TRUE, filename2 = NULL, analysisGroup2 = "Smaller Study Area", poly = TRUE, layerName = "Smaller Study Area") # adds a second studyArea within 1st rasTemplate <- raster(extent(studyArea(ml)), res = 0.001) tsf <- randomPolygons(rasTemplate, numTypes = 8)*30 crs(tsf) <- crs(ml) vtm <- randomPolygons(tsf, numTypes = 4) levels(vtm) <- data.frame(ID = sort(unique(vtm[])), Factor = c("black spruce", "white spruce", "aspen", "fir")) crs(vtm) <- crs(ml) ml <- mapAdd(tsf, ml, layerName = "tsf1", filename2 = "tsf1.tif", # to postProcess # to map object tsf = "tsf1.tif", # to column in map@metadata analysisGroup1 = "tsf1_vtm1", # this is the label for analysisGroup1 leaflet = TRUE, # to column in map@metadata; used for visualizing in leaflet overwrite = TRUE) ml <- mapAdd(vtm, ml, filename2 = "vtm1.grd", layerName = "vtm1", vtm = "vtm1.grd", analysisGroup1 = "tsf1_vtm1", leaflet = TRUE, overwrite = TRUE) ageClasses <- c("Young", "Immature", "Mature", "Old") ageClassCutOffs <- c(0, 40, 80, 120) # add an analysis -- this will trigger analyses because there are already objects in the map # This will trigger 2 analyses: # LeadingVegTypeByAgeClass on each raster x polygon combo (only 1 currently) # so there is 1 raster group, 2 polygon groups, 1 analyses - Total 2, 2 run now ml <- mapAddAnalysis(ml, functionName ="LeadingVegTypeByAgeClass", ageClasses = ageClasses, ageClassCutOffs = ageClassCutOffs) # add an analysis -- this will trigger analyses because there are already objects in the map # This will trigger 2 more analyses: # largePatches on each raster x polygon combo (only 1 currently) # so there is 1 raster group, 2 polygon groups, 2 analyses - Total 4, only 2 run now ml <- mapAddAnalysis(ml, functionName = "LargePatches", ageClasses = ageClasses, id = "1", labelColumn = "shinyLabel", ageClassCutOffs = ageClassCutOffs) # Add a second polygon, trigger smallStudyArea2 <- randomPolygon(studyArea(ml), 1e5) smallStudyArea2 <- SpatialPolygonsDataFrame(smallStudyArea2, data = data.frame(ID = 1, shinyLabel = "zone1"), match.ID = FALSE) # add a new layer -- this will trigger analyses because there are already analyese in the map # This will trigger 2 more analyses ... largePatches on each *new* raster x polygon combo # (now there are 2) -- so there is 1 raster group, 3 polygon groups, 2 analyses - Total 6 ml <- mapAdd(smallStudyArea2, ml, isStudyArea = FALSE, filename2 = NULL, overwrite = TRUE, analysisGroup2 = "Smaller Study Area 2", poly = TRUE, layerName = "Smaller Study Area 2") # adds a second studyArea within 1st # Add a *different* second polygon, via overwrite. This should trigger new analyses smallStudyArea2 <- randomPolygon(studyArea(ml), 1e5) smallStudyArea2 <- SpatialPolygonsDataFrame(smallStudyArea2, data = data.frame(ID = 1, shinyLabel = "zone1"), match.ID = FALSE) # add a new layer -- this will trigger analyses because there are already analyses in the map # This will trigger 2 more analyses ... largePatches on each *new* raster x polygon combo # (now there are 2) -- so there is 1 raster group, 3 polygon groups, 2 analyses - Total 6 ml <- mapAdd(smallStudyArea2, ml, isStudyArea = FALSE, filename2 = NULL, overwrite = TRUE, analysisGroup2 = "Smaller Study Area 2", poly = TRUE, layerName = "Smaller Study Area 2") # adds a second studyArea within 1st # Add a 2nd pair of rasters rasTemplate <- raster(extent(studyArea(ml)), res = 0.001) tsf2 <- randomPolygons(rasTemplate, numTypes = 8)*30 crs(tsf2) <- crs(ml) vtm2 <- randomPolygons(tsf2, numTypes = 4) levels(vtm2) <- data.frame(ID = sort(unique(vtm2[])), Factor = c("black spruce", "white spruce", "aspen", "fir")) crs(vtm2) <- crs(ml) ml <- mapAdd(tsf2, ml, filename2 = "tsf2.tif", layerName = "tsf2", tsf = "tsf2.tif", analysisGroup1 = "tsf2_vtm2", leaflet = TRUE, overwrite = TRUE) ml <- mapAdd(vtm2, ml, filename2 = "vtm2.grd", layerName = "vtm2", vtm = "vtm2.grd", analysisGroup1 = "tsf2_vtm2", leaflet = TRUE, overwrite = TRUE) # post hoc analysis of data # use or create a specialized function that can handle the analysesData slot ml <- mapAddPostHocAnalysis(map = ml, functionName = "rbindlistAG", postHocAnalysisGroups = "analysisGroup2", postHocAnalyses = "all") } ## cleanup setwd(cwd) unlink(tempdir(), recursive = TRUE) ## End(Not run)
map
objectTODO: description needed
mapAddAnalysis( map, functionName, useParallel = getOption("map.useParallel", FALSE), ... )
mapAddAnalysis( map, functionName, useParallel = getOption("map.useParallel", FALSE), ... )
map |
A |
functionName |
The name of the analysis function to add |
useParallel |
Logical indicating whether to use multiple threads.
Defaults to |
... |
Additional arguments passed to |
map
objectAdd a post hoc analysis function to a map
object
mapAddPostHocAnalysis( map, functionName, postHocAnalysisGroups = NULL, postHocAnalyses = "all", useParallel = getOption("map.useParallel", FALSE), ... )
mapAddPostHocAnalysis( map, functionName, postHocAnalysisGroups = NULL, postHocAnalyses = "all", useParallel = getOption("map.useParallel", FALSE), ... )
map |
Optional map object. If not provided, then one will be
created. If provided, then the present |
functionName |
A function that is designed for post hoc analysis of
map class objects, e.g., |
postHocAnalysisGroups |
Character string with one |
postHocAnalyses |
Character vector with |
useParallel |
Logical. If |
... |
Optional arguments to pass into |
This is the workhorse function that runs any analyses described in map@analyses
.
It uses hashing, and will not rerun any analysis that already ran on identical inputs.
mapAnalysis( map, functionName = NULL, purgeAnalyses = NULL, useParallel = getOption("map.useParallel", FALSE), ... )
mapAnalysis( map, functionName = NULL, purgeAnalyses = NULL, useParallel = getOption("map.useParallel", FALSE), ... )
map |
Optional map object. If not provided, then one will be
created. If provided, then the present |
functionName |
A function name that will be run on combinations of inputs in the map object. See details. |
purgeAnalyses |
A character string indicating which analysis group
combination or part thereof (e.g., the name entered into the row under
|
useParallel |
Logical. If |
... |
Additonal arguments passed to |
This function will do a sequence of things.
First, it will run expand.grid
on any columns whose names start with analysisGroup
,
creating a factorial set of analyses as described by these columns.
It will assess the combinations against the arguments used by the functionName
.
For any analysisGroup
that does not provide the correct arguments for the functionName
,
these analysisGroups
will be omitted for that particular function.
For efficiency, the function will then assess if any of these has already been run.
For those that have not been run, it will then run the
functionName
on arguments that it finds in the metadata
slot of
the map object, as well as any arguments passed in here in the ...
.
In general, the arguments being passed in here should be fixed across all
analyses, while any that vary by analysis should be entered into the metadata
table at the time of adding the layer to the map, via mapAdd
.
TODO
map
Remove objects from a map
mapRm(map, layer, ask = TRUE, ...) ## Default S3 method: mapRm(map = NULL, layer = NULL, ask = TRUE, ...)
mapRm(map, layer, ask = TRUE, ...) ## Default S3 method: mapRm(map = NULL, layer = NULL, ask = TRUE, ...)
map |
TODO: document this |
layer |
TODO: document this |
ask |
TODO: document this |
... |
TODO: document this |
Other mapMethods:
area,map-method
,
crs,map-method
,
rasterToMatch,map-method
,
rasters()
,
studyArea()
,
studyAreaName()
Other mapMethods:
area,map-method
,
crs,map-method
,
rasterToMatch,map-method
,
rasters()
,
studyArea()
,
studyAreaName()
if (require("SpaDES.tools", quietly = TRUE)) { p <- terra::vect(cbind(-120, 60), crs = "epsg:4326") |> SpaDES.tools::randomPolygon(area = 1e5) |> sf::st_as_sf() |> sf::as_Spatial() m <- mapAdd(p, layerName = "p") m m <- mapRm(m, "p") m }
if (require("SpaDES.tools", quietly = TRUE)) { p <- terra::vect(cbind(-120, 60), crs = "epsg:4326") |> SpaDES.tools::randomPolygon(area = 1e5) |> sf::st_as_sf() |> sf::as_Spatial() m <- mapAdd(p, layerName = "p") m m <- mapRm(m, "p") m }
Methods for specific classes exist.
metadata(x) ## S3 method for class 'Raster' metadata(x) ## S3 method for class 'map' metadata(x)
metadata(x) ## S3 method for class 'Raster' metadata(x) ## S3 method for class 'map' metadata(x)
x |
TODO: description needed |
map
objectThis will extract all objects in or pointed to within the map
.
rasters(map) ## S3 method for class 'map' rasters(map) sp(map) ## S3 method for class 'map' sp(map) sf(map) ## S3 method for class 'map' sf(map) spatialPolygons(map) spatialPoints(map) maps(map, class = NULL, layerName = NULL)
rasters(map) ## S3 method for class 'map' rasters(map) sp(map) ## S3 method for class 'map' sp(map) sf(map) ## S3 method for class 'map' sf(map) spatialPolygons(map) spatialPoints(map) maps(map, class = NULL, layerName = NULL)
map |
A |
class |
If supplied, this will be the class of objects returned. Default
is |
layerName |
TODO: description needed |
A list of maps (i.e., sp, raster, or sf objects) of class class
Other mapMethods:
area,map-method
,
crs,map-method
,
mapRm()
,
rasterToMatch,map-method
,
studyArea()
,
studyAreaName()
Other mapMethods:
area,map-method
,
crs,map-method
,
mapRm()
,
rasterToMatch,map-method
,
studyArea()
,
studyAreaName()
Other mapMethods:
area,map-method
,
crs,map-method
,
mapRm()
,
rasterToMatch,map-method
,
studyArea()
,
studyAreaName()
Other mapMethods:
area,map-method
,
crs,map-method
,
mapRm()
,
rasterToMatch,map-method
,
studyArea()
,
studyAreaName()
Other mapMethods:
area,map-method
,
crs,map-method
,
mapRm()
,
rasterToMatch,map-method
,
studyArea()
,
studyAreaName()
Other mapMethods:
area,map-method
,
crs,map-method
,
mapRm()
,
rasterToMatch,map-method
,
studyArea()
,
studyAreaName()
x
If layer
is not provided and there is more than one studyArea
,
then this will extract the last one added.
## S4 method for signature 'map' rasterToMatch(x, layer = 1)
## S4 method for signature 'map' rasterToMatch(x, layer = 1)
x |
TODO: describe this |
layer |
TODO: describe this |
Other mapMethods:
area,map-method
,
crs,map-method
,
mapRm()
,
rasters()
,
studyArea()
,
studyAreaName()
map
objectUtility functions for grouping analyses in a map
object
rbindlistAG(map, functionName, analysisGroups)
rbindlistAG(map, functionName, analysisGroups)
map |
Optional map object. If not provided, then one will be
created. If provided, then the present |
functionName |
TODO: description needed |
analysisGroups |
A character (length 1 currently), indicating which
analysis group (e.g., "analysisGroup1") should be used to |
A list of data.table
s.
runMapAnalyses
TODO: description needed
runMapAnalyses( map, purgeAnalyses = NULL, useParallel = getOption("map.useParallel", FALSE), ... )
runMapAnalyses( map, purgeAnalyses = NULL, useParallel = getOption("map.useParallel", FALSE), ... )
map |
TODO |
purgeAnalyses |
TODO |
useParallel |
TODO |
... |
TODO |
TODO
Show method for map class objects
## S4 method for signature 'map' show(object)
## S4 method for signature 'map' show(object)
object |
TODO: describe this |
map
If layer
is not provided and there is more than one studyArea
,
then this will extract the last one added.
studyArea(map, layer = NA, sorted = FALSE) ## S4 method for signature 'ANY' studyArea(map, layer = NA, sorted = FALSE) ## S4 method for signature 'map' studyArea(map, layer = NA, sorted = FALSE) studyArea(map, layer = NA) <- value ## S4 replacement method for signature 'map' studyArea(map, layer = NA) <- value
studyArea(map, layer = NA, sorted = FALSE) ## S4 method for signature 'ANY' studyArea(map, layer = NA, sorted = FALSE) ## S4 method for signature 'map' studyArea(map, layer = NA, sorted = FALSE) studyArea(map, layer = NA) <- value ## S4 replacement method for signature 'map' studyArea(map, layer = NA) <- value
map |
TODO: document this |
layer |
TODO: document this |
sorted |
Logical. Should the numeric |
value |
The value to assign to the object. |
Other mapMethods:
area,map-method
,
crs,map-method
,
mapRm()
,
rasterToMatch,map-method
,
rasters()
,
studyAreaName()
Other mapMethods:
area,map-method
,
crs,map-method
,
mapRm()
,
rasterToMatch,map-method
,
rasters()
,
studyAreaName()
Other mapMethods:
area,map-method
,
crs,map-method
,
mapRm()
,
rasterToMatch,map-method
,
rasters()
,
studyAreaName()
Other mapMethods:
area,map-method
,
crs,map-method
,
mapRm()
,
rasterToMatch,map-method
,
rasters()
,
studyAreaName()
Tools for getting objects and metadata in and out of a map
class.
studyAreaName(x, layer) ## S3 method for class 'map' studyAreaName(x, layer = 1) ## S3 method for class 'data.table' studyAreaName(x, layer = 1)
studyAreaName(x, layer) ## S3 method for class 'map' studyAreaName(x, layer = 1) ## S3 method for class 'data.table' studyAreaName(x, layer = 1)
x |
TODO: document this |
layer |
TODO: document this |
Other mapMethods:
area,map-method
,
crs,map-method
,
mapRm()
,
rasterToMatch,map-method
,
rasters()
,
studyArea()
Other mapMethods:
area,map-method
,
crs,map-method
,
mapRm()
,
rasterToMatch,map-method
,
rasters()
,
studyArea()
Other mapMethods:
area,map-method
,
crs,map-method
,
mapRm()
,
rasterToMatch,map-method
,
rasters()
,
studyArea()