Title: | Tools to Deal with Raster Maps |
---|---|
Description: | A collection of tools to deal with raster maps. |
Authors: | Clement Calenge [aut, cre], Mathieu Basille [ctb] |
Maintainer: | Clement Calenge <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.3.17 |
Built: | 2024-11-05 04:57:32 UTC |
Source: | https://github.com/clementcalenge/adehabitatma |
The function adeoptions
defines the options for the package
adehabitatMA
, and more generally, for all brother packages
(adehabitatHR
, adehabitatHS
and adehabitatLT
).
adeoptions(...)
adeoptions(...)
... |
a list of named elements giving the value of options for
the package |
This functions sets the value of components of the internal list
.adeoptions
, which contains the values of the options. Two
options are currently implemented:
epsilon
: The smallest significant distance between two points
above which we should consider to deal with two separate
locations.
shortprint
: logical. Defines whether special show
methods should be used when printing objects belonging to classes of
the package sp
a list of options for the package adehabitatMA
Clement Calenge [email protected]
## load the data data(lynxjura) ## short printing method oldopt <- adeoptions(shortprint=TRUE) lynxjura$map ## 'sp' print method for Spatial objects adeoptions(shortprint=FALSE) lynxjura$map ## original options adeoptions(oldopt) lynxjura$map
## load the data data(lynxjura) ## short printing method oldopt <- adeoptions(shortprint=TRUE) lynxjura$map ## 'sp' print method for Spatial objects adeoptions(shortprint=FALSE) lynxjura$map ## original options adeoptions(oldopt) lynxjura$map
ascgen
creates an object of class SpatialPixelsDataFrame
using a set of points contained in an object of class
SpatialPointsDataFrame
.
ascgen(xy, cellsize = NULL, nrcol = NULL, count = TRUE)
ascgen(xy, cellsize = NULL, nrcol = NULL, count = TRUE)
xy |
an object inheriting the class |
cellsize |
the cell size (resolution) of the object of class
|
nrcol |
the size of the square raster map to be created (number of rows/columns) |
count |
logical. If |
Returns an object of class SpatialPixelsDataFrame
.
Clement Calenge [email protected]
SpatialPixelsDataFrame-class
for additional
information on objects of class SpatialPixelsDataFrame
and
SpatialPoints-class
for additional information on
objects of class SpatialPoints
.
## generates a random sample of points xy <- matrix(runif(1000), ncol=2) ## coerce them to SpatialPoints xy <- SpatialPoints(xy) plot(xy) ## generate a SpatialPixelsDataFrame ## (and count the number of points) spd <- ascgen(xy, cellsize=0.1) image(spd)
## generates a random sample of points xy <- matrix(runif(1000), ncol=2) ## coerce them to SpatialPoints xy <- SpatialPoints(xy) plot(xy) ## generate a SpatialPixelsDataFrame ## (and count the number of points) spd <- ascgen(xy, cellsize=0.1) image(spd)
buffer
computes buffers regions from spatial objects belonging
to the following classes:
SpatialPoints
(all pixels located within a specified distance
of a point take the value one)
SpatialPointsDataFrame
with one column (this column is
considered to be a factor, and the buffer is computed for each level
of this factor)
SpatialLines
to compute buffers from lines.
SpatialPolygons
to compute buffers from polygons.
buffer(xy, x, dist)
buffer(xy, x, dist)
xy |
an object of class |
x |
an object inheriting the class |
dist |
a value of distance |
An object of class SpatialPixelsDataFrame
.
Clement Calenge [email protected]
SpatialPixelsDataFrame-class
for additionnal
information on objects of class SpatialPixelsDataFrame
.
data(lynxjura) # locs is the SpatialPointsDataFrame containing the # locations of lynx indices in the Jura mountains locs <- lynxjura$locs head(locs) ## just for the sake of illustration: sample 100 points suppressWarnings(RNGversion("3.5.0")) set.seed(233) locs <- locs[sample(1:nrow(locs), 100),] # sa is the SpatialPixelsDataFrame object containing # maps of the study area sa <- lynxjura$map # Buffer of 2000 m from all points bu <- buffer(locs, sa, 2000) image(bu) # displays all the pixels of the study area within 2000 m # of a point, for each type of indices (see ?lynxjura) buani <- buffer(locs[,2], sa, 2000) buani par(mar=c(0,0,2,0)) opar<-par(mfrow=c(3,4)) lapply(1:11, function(i) { image(buani[,i]) title(main = names(slot(buani, "data"))[i]) }) par(opar) ## buffer from a polygon sa2 <- sa[,4] sa2[[1]][sa2[[1]]<5000] <- NA image(sa2) ## gets the contour line gc <- getcontour(sa2) plot(gc, add=TRUE) ## a buffer of 2000 metres image(buffer(gc, sa, 2000)) plot(gc, add=TRUE)
data(lynxjura) # locs is the SpatialPointsDataFrame containing the # locations of lynx indices in the Jura mountains locs <- lynxjura$locs head(locs) ## just for the sake of illustration: sample 100 points suppressWarnings(RNGversion("3.5.0")) set.seed(233) locs <- locs[sample(1:nrow(locs), 100),] # sa is the SpatialPixelsDataFrame object containing # maps of the study area sa <- lynxjura$map # Buffer of 2000 m from all points bu <- buffer(locs, sa, 2000) image(bu) # displays all the pixels of the study area within 2000 m # of a point, for each type of indices (see ?lynxjura) buani <- buffer(locs[,2], sa, 2000) buani par(mar=c(0,0,2,0)) opar<-par(mfrow=c(3,4)) lapply(1:11, function(i) { image(buani[,i]) title(main = names(slot(buani, "data"))[i]) }) par(opar) ## buffer from a polygon sa2 <- sa[,4] sa2[[1]][sa2[[1]]<5000] <- NA image(sa2) ## gets the contour line gc <- getcontour(sa2) plot(gc, add=TRUE) ## a buffer of 2000 metres image(buffer(gc, sa, 2000)) plot(gc, add=TRUE)
calcperimeter
computes the perimeters of polygons in objects of
class SpatialPolygonsDataFrame
and PolyLinesDataFrame
.
calcperimeter(x)
calcperimeter(x)
x |
object of class |
an object of class SpatialPolygonsDataFrame
or
PolyLinesDataFrame
with an additionnal column containing the
perimeter of the polygons/polylines.
Clement Calenge [email protected]
SpatialPolygonsDataFrame-class
for
additionnal information on objects of class
SpatialPolygonsDataFrame
.
data(meuse.grid) a <- SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")], data = meuse.grid) ## the contour of the map gc <- getcontour(a[,1]) plot(gc) ## Transforms the SpatialPolygons into SpatialPolygonsDataFrame gc <- SpatialPolygonsDataFrame(gc, data.frame(x=1)) ## The perimeter of this map (in units of the data): ii <- calcperimeter(gc) as.data.frame(ii)
data(meuse.grid) a <- SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")], data = meuse.grid) ## the contour of the map gc <- getcontour(a[,1]) plot(gc) ## Transforms the SpatialPolygons into SpatialPolygonsDataFrame gc <- SpatialPolygonsDataFrame(gc, data.frame(x=1)) ## The perimeter of this map (in units of the data): ii <- calcperimeter(gc) as.data.frame(ii)
count.points
counts the number of points in
each pixel of a raster map inheriting the class
SpatialPixels
.
count.points(xy, w)
count.points(xy, w)
xy |
an object of class |
w |
an object inheriting the class |
an object of class SpatialPixelsDataFrame
containing the number
of points in each cell of the raster map. If xy
is a
SpatialPointsDataFrame
with one column (a factor), the
resulting object contains one column per level of this factor.
Clement Calenge [email protected]
SpatialPixelsDataFrame-class
for additionnal
information on objects of class SpatialPixelsDataFrame
.
data(lynxjura) # locs is the SpatialPointsDataFrame containing the # locations of presence indices of Lynx in the Jura mountains (France) locs <- lynxjura$locs head(locs) # sa is the SpatialPixelsDataFrame object containing # maps of the study area sa <- lynxjura$map # Count all points cp <- count.points(locs, sa) cp image(cp) # count the points per type of lynx presence indices: cp <- count.points(locs[,2], sa) cp
data(lynxjura) # locs is the SpatialPointsDataFrame containing the # locations of presence indices of Lynx in the Jura mountains (France) locs <- lynxjura$locs head(locs) # sa is the SpatialPixelsDataFrame object containing # maps of the study area sa <- lynxjura$map # Count all points cp <- count.points(locs, sa) cp image(cp) # count the points per type of lynx presence indices: cp <- count.points(locs[,2], sa) cp
This function computes maps of distances to patches belonging to the
different levels of a factor variable (mapped in an object of class
SpatialPixelsDataFrame
).
distfacmap(x, lev = NULL)
distfacmap(x, lev = NULL)
x |
an object of class |
lev |
a vector of character strings giving the labels of the levels of the factor. |
An object of class SpatialPixelsDataFrame
.
Clement Calenge [email protected]
SpatialPixelsDataFrame-class
for additionnal
information on objects of class SpatialPixelsDataFrame
.
## Load meuse.grid data set and converts it to ## SpatialPixelsDataFrame data(meuse.grid) m <- SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")], data = meuse.grid) ## look at the soil type image(m[,6]) ## compute the distance to each soil type sor <- distfacmap(m[,6], lev = c("type1","type2", "type3")) ## The results sor mimage(sor)
## Load meuse.grid data set and converts it to ## SpatialPixelsDataFrame data(meuse.grid) m <- SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")], data = meuse.grid) ## look at the soil type image(m[,6]) ## compute the distance to each soil type sor <- distfacmap(m[,6], lev = c("type1","type2", "type3")) ## The results sor mimage(sor)
This interface allows to explore distances, values, etc. on a map of
class SpatialPixelsDataFrame
.
explore(ka, coltxt="black", hscale = 1, vscale = 1, panel.last = NULL, ...)
explore(ka, coltxt="black", hscale = 1, vscale = 1, panel.last = NULL, ...)
ka |
An object of class |
coltxt |
character. the color of the text to be printed |
hscale |
passed to tkrplot |
vscale |
passed to tkrplot |
panel.last |
an expression to be evaluated after plotting has taken place |
... |
additional parameters to be passed to the function
|
Clement Calenge [email protected]
SpatialPixelsDataFrame-class
for additionnal
information on objects of class SpatialPixelsDataFrame
.
## Not run: data(meuse.grid) m <- SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")], data = meuse.grid) explore(m[,3:5]) data(lynxjura) explore(lynxjura$map, panel.last=function() points(lynxjura$locs)) ## End(Not run)
## Not run: data(meuse.grid) m <- SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")], data = meuse.grid) explore(m[,3:5]) data(lynxjura) explore(lynxjura$map, panel.last=function() points(lynxjura$locs)) ## End(Not run)
getcontour
computes the contour polygon of a raster object
of class SpatialPixelsDataFrame
. When the object is made of
several parts, the function returns one polygon per part.
getcontour(sp)
getcontour(sp)
sp |
an object of class |
Returns an object of class SpatialPolygons
.
Holes in the polygons are not taken into account by the function.
Clement Calenge [email protected]
SpatialPixelsDataFrame-class
for additionnal
information on objects of class SpatialPixelsDataFrame
.
data(meuse.grid) a <- SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")], data = meuse.grid) ## the contour of the map gc <- getcontour(a[,1]) plot(gc)
data(meuse.grid) a <- SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")], data = meuse.grid) ## the contour of the map gc <- getcontour(a[,1]) plot(gc)
hist.SpatialPixelsDataFrame
performs histograms of the
variables mapped in objects of class SpatialPixelsDataFrame
.
## S3 method for class 'SpatialPixelsDataFrame' hist(x, type = c("h", "l", "b"), adjust = 1, col, border, lwd = 1, ...)
## S3 method for class 'SpatialPixelsDataFrame' hist(x, type = c("h", "l", "b"), adjust = 1, col, border, lwd = 1, ...)
x |
a raster map of class |
type |
what type of plot should be drawn. Possible types are: |
adjust |
if |
col |
color for the histogram |
border |
color for the border of the histogram |
lwd |
if |
... |
further arguments passed to or from other methods |
Mathieu Basille [email protected]
SpatialPixelsDataFrame-class
for additionnal
information on objects of class SpatialPixelsDataFrame
.
data(lynxjura) hist(lynxjura$map, type = "h") hist(lynxjura$map, type = "l")
data(lynxjura) hist(lynxjura$map, type = "h") hist(lynxjura$map, type = "l")
join
finds the value of a mapped variable at some specified
locations.
join(xy, x)
join(xy, x)
x |
an object of class |
xy |
an object of class |
If only one variable is mapped in x
, a vector with length
equals to the number of points in xy
.
If only several variables are mapped in x
, a data.frame
with a number of columns equal to the number of variables in the
object of class SpatialPixelsDataFrame
, and with each row
corresponding to the rows of xy
.
Clement Calenge [email protected]
SpatialPixelsDataFrame-class
for additionnal
information on objects of class SpatialPixelsDataFrame
.
SpatialPoints-class
for additionnal information on
objects of class SpatialPoints
.
data(lynxjura) ## show the data image(lynxjura$map) points(lynxjura$locs) ## join the data to the maps: res <- join(lynxjura$locs, lynxjura$map) head(res)
data(lynxjura) ## show the data image(lynxjura$map) points(lynxjura$locs) ## join the data to the maps: res <- join(lynxjura$locs, lynxjura$map) head(res)
These functions convert maps of classes available in adehabitat toward
classes available in the package sp
and conversely.
kasc2spixdf
converts an object of class kasc
into an
object of class SpatialPixelsDataFrame
.
asc2spixdf
converts an object of class asc
into an
object of class SpatialGridDataFrame
.
area2spol
converts an object of class area
into an
object of class SpatialPolygons
.
spol2area
converts an object of class SpatialPolygons
or
SpatialPolygonsDataFrame
into an object of class
area
.
attpol2area
gets the data attribute of an object of class
SpatialPolygonsDataFrame
and stores it into a data frame.
kasc2spixdf(ka) asc2spixdf(a) area2spol(ar) spol2area(sr) attpol2area(srdf)
kasc2spixdf(ka) asc2spixdf(a) area2spol(ar) spol2area(sr) attpol2area(srdf)
ka |
an object of class |
a |
an object of class |
ar |
an object of class |
sr |
an object of class |
srdf |
an object of class |
We describe here more in detail the functions spol2area
and
attpol2area
. Objects of class area
do not deal with
holes in the polygons, whereas the objects of class
SpatialPolygons
do. Therefore, when holes are present in the
SpatialPolygons
object passed as argument, the function
spol2area
ignore them and returns only the external contour of
the polygon (though a warning is returned).
Clement Calenge [email protected]
This function attributes unique labels to pixels belonging to connected
features on a map of class SpatialPixelsDataFrame
.
labcon(x)
labcon(x)
x |
an object of class |
Returns a matrix of class asc
, of type "factor"
, with a
number of levels equals to the number of connected components
Clement Calenge [email protected]
SpatialPixelsDataFrame-class
for further
information on the class SpatialPixelsDataFrame
data(lynxjura) sa <- lynxjura$map[,1] ## build an image with separate components sa[[1]][sa[[1]]<50] <- NA ## show the connected components image(sa) image(labcon(sa))
data(lynxjura) sa <- lynxjura$map[,1] ## build an image with separate components sa[[1]][sa[[1]]<50] <- NA ## show the connected components image(sa) image(labcon(sa))
lowres
is used to reduce the resolution of
maps of class SpatialPixelsDataFrame
.
lowres(x, np = 2, which.fac=NULL, ...)
lowres(x, np = 2, which.fac=NULL, ...)
x |
an object of class |
np |
a number giving the number of pixels to merge together (see below) |
which.fac |
a vector containing the indices of the columns of
|
... |
further arguments passed to or from other methods |
The function merges together squares of np * np
pixels. For
variables of type "numeric"
, the function averages the value of
the variable. For maps of type "factor"
, the function gives
the most frequent level in the square of np * np
pixels. When
several levels are equally represented in the square of np * np
pixels, the function randomly samples one of these levels.
Returns an object of class SpatialPixelsDataFrame
.
Clement Calenge [email protected]
SpatialPixelsDataFrame-class
for further
information on objects of class SpatialPixelsDataFrame
.
data(meuse.grid) m <- SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")], data = meuse.grid) m m <- m[,3:6] ## The initial image image(m,3) ## The transformed image m2 <- lowres(m, np = 4) image(m2, 3)
data(meuse.grid) m <- SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")], data = meuse.grid) m m <- m[,3:6] ## The initial image image(m,3) ## The transformed image m2 <- lowres(m, np = 4) image(m2, 3)
This data set stores the results of the monitoring of lynx in the French Jura between 1980 and 1999. These data have been collected by the Lynx Network of the french wildlife management office (Office national de la chasse et de la faune sauvage).
data(lynxjura)
data(lynxjura)
The list lynxjura
has two components:
map
is an object of class SpatialPixelsDataFrame
(see help(SpatialPixelsDataFrame)
) that describes several
variables on the study area: forets
is the density of
forests, hydro
is the density of rivers, routes
is the
density of roads and artif
is the distance from urbanized
areas.
locs
is an object of class SpatialPointsDataFrame
containing the locations of presence indices of the lynx. X
and Y
are the x and y coordinates, Date
is the date of
the collection of the indice and Type
represents the type of
data (C
: alive lynx captured, D
: attacks on livestock,
E
: prints or tracks, F
: feces, J
: hairs,
L
: corpse of lynx, O
: sightings and P
: attacks
on wild prey).
Vandel, J.M. (2001) Repartition du Lynx (Lynx lynx) en France (Massif Alpin, Jurassien et Vosgien). Methodologie d'etude et statut actuel. Ecole Pratique des Haute Etudes de Montpellier II: Dissertation.
This function allows to display the whole content of an object of
class SpatialPixelsDataFrame
mimage(x, var = names(slot(x, "data")), col = gray((240:1)/256), mfrow = NULL)
mimage(x, var = names(slot(x, "data")), col = gray((240:1)/256), mfrow = NULL)
x |
an object of class |
var |
The names or index of the variables to be plotted |
col |
a vector of colors to be used for plotting |
mfrow |
The parameter |
Clement Calenge [email protected]
par
for information about mfrow
, and
SpatialPixelsDataFrame-class
for additionnal
information on objects of class SpatialPixelsDataFrame
.
data(lynxjura) lynxjura$map mimage(lynxjura$map) mimage(lynxjura$map, c("forets", "routes"), col=grey(seq(0,1, length=100)))
data(lynxjura) lynxjura$map mimage(lynxjura$map) mimage(lynxjura$map, c("forets", "routes"), col=grey(seq(0,1, length=100)))
morphology
performs morphological operations on images
of class SpatialPixelsDataFrame
.
morphology(x, operation = c("erode", "dilate"), nt = 5)
morphology(x, operation = c("erode", "dilate"), nt = 5)
x |
a matrix of class |
operation |
a character string indicating the operation to be
processed: either |
nt |
the number of times that the operation should be processed |
Returns an object of class SpatialPixelsDataFrame
with one
column, containing 1 when the pixel belong to one feature of the image
and NA
otherwise (see examples).
Clement Calenge [email protected]
SpatialPixelsDataFrame-class
for further
information on objects of class SpatialPixelsDataFrame
.
data(meuse.grid) a <- SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")], data = meuse.grid) ## dilatation toto1 <- morphology(a, operation = "dilate", nt = 1) toto2 <- morphology(a, operation = "dilate", nt = 2) toto3 <- morphology(a, operation = "dilate", nt = 3) toto5 <- morphology(a, operation = "dilate", nt = 5) colo <- grey((1:5)/6) image(toto5, col = colo[1]) image(toto3, add = TRUE, col = colo[2]) image(toto2, add = TRUE, col = colo[3]) image(toto1, add = TRUE, col = colo[4]) image(a, add = TRUE) ## erosion colo <- grey((1:12)/13) image(a, col = "black") for (i in 1:12) { toto <- morphology(a, operation = "erode", nt = i) image(toto, add = TRUE, col = colo[i]) }
data(meuse.grid) a <- SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")], data = meuse.grid) ## dilatation toto1 <- morphology(a, operation = "dilate", nt = 1) toto2 <- morphology(a, operation = "dilate", nt = 2) toto3 <- morphology(a, operation = "dilate", nt = 3) toto5 <- morphology(a, operation = "dilate", nt = 5) colo <- grey((1:5)/6) image(toto5, col = colo[1]) image(toto3, add = TRUE, col = colo[2]) image(toto2, add = TRUE, col = colo[3]) image(toto1, add = TRUE, col = colo[4]) image(a, add = TRUE) ## erosion colo <- grey((1:12)/13) image(a, col = "black") for (i in 1:12) { toto <- morphology(a, operation = "erode", nt = i) image(toto, add = TRUE, col = colo[i]) }
This data set stores the results of the monitoring of 4 wild boars at Puechabon (Mediterranean habitat, South of France). These data have been collected by Daniel Maillard (Office national de la chasse et de la faune sauvage).
data(puechabonsp)
data(puechabonsp)
The list puechabonsp
has two components:
puechabonsp$map
is an object of class SpatialPixelsDataFrame
that describes several
variables on the study area.
puechabonsp$relocs
is an object of class SpatialPointsDataFrame
containing the relocations of the wild boar resting sites in
summer. Information on wild boars is provided by factors Name
,
Sex
, Age
.
Maillard, D. (1996). Occupation et utilisation de la garrigue et du vignoble mediterraneens par le Sanglier. Universite d'Aix-Marseille III: PhD thesis.
These are functions allowing a shorter print of the content of objects
of class SpatialPolygonsDataFrame
,
SpatialPixelsDataFrame
, SpatialPixels
, and
SpatialGridDataFrame
. Original printing methods can be
recovered by setting adeoptions(shortprint=FALSE)
.
show function for the class SpatialGridDataFrame
.
show function for the class SpatialPixels
.
show function for the class SpatialPixelsDataFrame
.
show function for the class SpatialPolygonsDataFrame
.
subsetmap
is used to store a part of any given map of class
SpatialPixelsDataFrame
into an other object.
subsetmap(x, xlim = NULL, ylim = NULL, ...)
subsetmap(x, xlim = NULL, ylim = NULL, ...)
x |
an object of class |
xlim |
numerical vector of length 2. The x limits of the rectangle including the new map |
ylim |
numerical vector of length 2. The y limits of the rectangle including the new map |
... |
further arguments passed to or from other methods |
If xlim
or ylim
are not provided, the function asks the
user to click on the map to delimit the lower left corner and the
higher right corner of the new map (see Examples).
Returns an object of class SpatialPixelsDataFrame
Clement Calenge [email protected], improvements by Jon Olav Vik
data(lynxjura) map <- lynxjura$map ## limits of the new map: xl <- c(839938.7, 858990.8) yl <- c(2149019, 2168761) ## computation of the new map: su <- subsetmap(map, xlim = xl, ylim = yl) su ## Display opar <- par(mar = c(0,0,0,0)) layout(matrix(c(1,1,1,1,1,1,1,1,2), byrow = TRUE, ncol = 3)) image(map, axes = FALSE) polygon(c(xl[1], xl[2], xl[2], xl[1]), c(yl[1], yl[1], yl[2], yl[2])) image(su, axes = FALSE) box() par(opar) par(mfrow = c(1,1)) ## Not run: ## Interactive example su <- subsetmap(map) image(su) ## End(Not run)
data(lynxjura) map <- lynxjura$map ## limits of the new map: xl <- c(839938.7, 858990.8) yl <- c(2149019, 2168761) ## computation of the new map: su <- subsetmap(map, xlim = xl, ylim = yl) su ## Display opar <- par(mar = c(0,0,0,0)) layout(matrix(c(1,1,1,1,1,1,1,1,2), byrow = TRUE, ncol = 3)) image(map, axes = FALSE) polygon(c(xl[1], xl[2], xl[2], xl[1]), c(yl[1], yl[1], yl[2], yl[2])) image(su, axes = FALSE) box() par(opar) par(mfrow = c(1,1)) ## Not run: ## Interactive example su <- subsetmap(map) image(su) ## End(Not run)