map_dens()
creates a smoothed utilisation distribution (UD).
as.im.SpatRaster(.map)
as.owin.SpatRaster(.map, .im = NULL)
as.owin.sf(.poly, .bbox = sf::st_bbox(.poly), .invert = TRUE)
map_dens(
.map,
.owin = as.owin.SpatRaster(.map),
.coord = NULL,
.discretise = FALSE,
.shortcut = list(),
...,
.plot = TRUE,
.use_tryCatch = TRUE,
.verbose = getOption("patter.verbose")
)
A SpatRaster
that defines the grid on which the UD is represented. If .coord = NULL
, .map
also defines the points (and associated weights) that are smoothed (see .map_coord()
). The coordinate reference system of .map
must be planar and specified.
A pixel image representation of .map
(see as.im.SpatRaster()
and spatstat.geom::im()
) and an observation window (see as.owin.SpatRaster()
, as.owin.sf()
and spatstat.geom::owin()
). If un-supplied, .owin
is defined automatically from .map
via as.owin.SpatRaster()
, which uses as.im.SpatRaster()
internally (see Details). For faster results, use a rectangular or polygon observation window (see as.owin.sf()
).
For as.owin.sf()
to construct observation windows from sf
objects.
.poly
is an sf
polygon object;
.bbox
is the bounding of a simple feature (see sf::st_bbox()
);
.invert
is a logical variable that defines whether or not to invert .poly
(e.g., to turn a terrestrial polygon into an aquatic polygon);
(optional) Coordinates for density estimation, provided in any format accepted by .map_coord()
. Coordinates must be planar.
If .coord
is provided, .discretise
is a logical
variable that defines whether or not to discretise coordinates on .map
(see .map_coord()
).
(optional) A named list
from a previous call to map_dens()
. If supplied, the function short-cuts straight to smoothing (.owin
, .coord
and .discretise
are silently unused).
Arguments for density estimation, passed to spatstat.explore::density.ppp()
, such as sigma
(i.e., the bandwidth). at
and se
are not permitted.
A logical
variable that defines whether or not to plot the output.
A logical
variable that controls error handling:
If .use_tryCatch = FALSE
, if density estimation fails with an error, the function fails with the same error.
If .use_tryCatch = TRUE
, if density estimation fails with an error, the function produces a warning with the error message and returns NULL
.
User output control (see patter-progress
for supported options).
The function returns a named list
, with the following elements:
x
: a spatstat.geom::ppp
object that defines points for density estimation;
D
: a spatstat.geom::im
object of estimated intensities, from spatstat.explore::density.ppp()
;
ud
: a normalised SpatRaster
;
D
and ud
are NULL
if spatstat.explore::density.ppp()
fails and .use_tryCatch = TRUE
.
map_dens()
smooths (a) a SpatRaster
or (b) a set of inputted coordinates.
.map_coord()
(and .map_mark()
) are used to define coordinates and weights:
If .coords
is NULL
, .map
cell coordinates are used for density estimation and cell values are used as weights.
If coordinates are supplied, coordinates are optionally re-expressed on .map
and then used for density estimation. This option is generally faster. Coordinate weights are defined by .map_mark()
.
Cell coordinates and associated weights are converted to a spatstat.geom::ppp()
object, which is passed, alongside the observation window (.owin
), to spatstat.explore::density.ppp()
for the estimation. Weights must sum to one.
as.im.SpatRaster()
, as.owin.SpatRaster()
and as.owin.sf()
are helper functions that convert a SpatRaster
to a pixel image and an observation window (see spatstat.geom::owin()
). as.im.SpatRaster()
is based on maptools::as.im.RasterLayer()
. as.owin.SpatRaster()
either defines a rectangular window, if there are no NAs on .map
, or converts .map
directly to an owin
object. Gridded observation windows, especially if high resolution, considerably slow down density estimation and may exhaust vector memory. Use rectangular windows, or convert sf
objects to polygon windows (via as.owin.sf()
) if possible.
If .shortcut
is supplied, the preceding steps can be skipped and the function short-cuts straight to smoothing. Use this option if the preceding steps are slow and you want to trial different smoothing options (such as sigma
functions).
Coordinates and associated weights are smoothed via spatstat.explore::density.ppp()
into an image. Pixel resolution and smoothing parameters such as bandwidth can be controlled via ...
arguments which are passed directly to this function. The output is translated into a gridded probability density surface (on the geometry defined by .map
).
This function replaces flapper::kud*()
and flapper::pf_kud*()
routines based on adehabitatHR
(see here).
map_*()
functions build maps of space use:
map_pou()
maps probability-of-use;
map_dens()
maps point density;
map_hr
_*()
functions map home ranges;
All maps are represented as SpatRaster
s.
To derive coordinates for mapping patterns of space use for tagged animals, see:
coa()
to calculate centre-of-activity;
pf_filter()
and associates to sample locations using particle filtering;
library(data.table)
library(dtplyr)
library(dplyr, warn.conflicts = FALSE)
library(spatstat.explore)
#> Warning: package ‘spatstat.explore’ was built under R version 4.3.3
#> Loading required package: spatstat.data
#> Warning: package ‘spatstat.data’ was built under R version 4.3.3
#> Loading required package: spatstat.univar
#> Warning: package ‘spatstat.univar’ was built under R version 4.3.3
#> spatstat.univar 3.0-0
#> Loading required package: spatstat.geom
#> Warning: package ‘spatstat.geom’ was built under R version 4.3.3
#> spatstat.geom 3.3-2
#>
#> Attaching package: ‘spatstat.geom’
#> The following object is masked from ‘package:data.table’:
#>
#> shift
#> Loading required package: spatstat.random
#> Warning: package ‘spatstat.random’ was built under R version 4.3.3
#> spatstat.random 3.3-1
#> Loading required package: nlme
#> Warning: package ‘nlme’ was built under R version 4.3.3
#>
#> Attaching package: ‘nlme’
#> The following object is masked from ‘package:dplyr’:
#>
#> collapse
#> spatstat.explore 3.3-1
#### Define map
map <- dat_gebco()
#### Example (1): Use sample coordinates
# Sample example coordinates
coord <-
map |>
terra::spatSample(size = 5000L, xy = TRUE, cell = TRUE, na.rm = TRUE) |>
select("x", "y") |>
as.data.table()
# Use x, y coordinates
map_dens(map, .coord = coord)
#> `patter::map_dens()` called @ 2024-08-01 11:41:26...
#> ... 11:41:26: Processing `.map`...
#> ... 11:41:26: Building XYM...
#> ... 11:41:26: Defining `ppp` object...
#> Observation window is gridded.
#> ... 11:41:26: Estimating density surface...
#> ... 11:41:26: Scaling density surface...
#> `patter::map_dens()` call ended @ 2024-08-01 11:41:26 (duration: ~0 sec(s)).
#> $x
#> Marked planar point pattern: 5000 points
#> marks are numeric, of storage type ‘double’
#> window: binary image mask
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695492.1, 714492.1] x [6246657, 6273057] units
#>
#> $D
#> real-valued pixel image
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695490, 714490] x [6246700, 6273100] units
#>
#> $ud
#> class : SpatRaster
#> dimensions : 264, 190, 1 (nrow, ncol, nlyr)
#> resolution : 100, 100 (x, y)
#> extent : 695492.1, 714492.1, 6246657, 6273057 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 29N (EPSG:32629)
#> source(s) : memory
#> name : lyr.1
#> min value : 5.607983e-05
#> max value : 6.495713e-05
#>
# Other formats are acceptable
map_dens(map, .coord = as.matrix(coord))
#> `patter::map_dens()` called @ 2024-08-01 11:41:26...
#> ... 11:41:26: Processing `.map`...
#> ... 11:41:26: Building XYM...
#> ... 11:41:26: Defining `ppp` object...
#> Observation window is gridded.
#> ... 11:41:26: Estimating density surface...
#> ... 11:41:26: Scaling density surface...
#> `patter::map_dens()` call ended @ 2024-08-01 11:41:27 (duration: ~1 sec(s)).
#> $x
#> Marked planar point pattern: 5000 points
#> marks are numeric, of storage type ‘double’
#> window: binary image mask
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695492.1, 714492.1] x [6246657, 6273057] units
#>
#> $D
#> real-valued pixel image
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695490, 714490] x [6246700, 6273100] units
#>
#> $ud
#> class : SpatRaster
#> dimensions : 264, 190, 1 (nrow, ncol, nlyr)
#> resolution : 100, 100 (x, y)
#> extent : 695492.1, 714492.1, 6246657, 6273057 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 29N (EPSG:32629)
#> source(s) : memory
#> name : lyr.1
#> min value : 5.607983e-05
#> max value : 6.495713e-05
#>
map_dens(map, .coord = as.data.frame(coord))
#> `patter::map_dens()` called @ 2024-08-01 11:41:27...
#> ... 11:41:27: Processing `.map`...
#> ... 11:41:27: Building XYM...
#> ... 11:41:27: Defining `ppp` object...
#> Observation window is gridded.
#> ... 11:41:27: Estimating density surface...
#> ... 11:41:27: Scaling density surface...
#> `patter::map_dens()` call ended @ 2024-08-01 11:41:27 (duration: ~0 sec(s)).
#> $x
#> Marked planar point pattern: 5000 points
#> marks are numeric, of storage type ‘double’
#> window: binary image mask
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695492.1, 714492.1] x [6246657, 6273057] units
#>
#> $D
#> real-valued pixel image
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695490, 714490] x [6246700, 6273100] units
#>
#> $ud
#> class : SpatRaster
#> dimensions : 264, 190, 1 (nrow, ncol, nlyr)
#> resolution : 100, 100 (x, y)
#> extent : 695492.1, 714492.1, 6246657, 6273057 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 29N (EPSG:32629)
#> source(s) : memory
#> name : lyr.1
#> min value : 5.607983e-05
#> max value : 6.495713e-05
#>
# `cell_x` and `cell_y` coordinates are acceptable
map_dens(map, .coord = coord[, .(cell_x = x, cell_y = y)])
#> `patter::map_dens()` called @ 2024-08-01 11:41:27...
#> ... 11:41:27: Processing `.map`...
#> ... 11:41:27: Building XYM...
#> ... 11:41:27: Defining `ppp` object...
#> Observation window is gridded.
#> ... 11:41:27: Estimating density surface...
#> ... 11:41:27: Scaling density surface...
#> `patter::map_dens()` call ended @ 2024-08-01 11:41:27 (duration: ~0 sec(s)).
#> $x
#> Marked planar point pattern: 5000 points
#> marks are numeric, of storage type ‘double’
#> window: binary image mask
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695492.1, 714492.1] x [6246657, 6273057] units
#>
#> $D
#> real-valued pixel image
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695490, 714490] x [6246700, 6273100] units
#>
#> $ud
#> class : SpatRaster
#> dimensions : 264, 190, 1 (nrow, ncol, nlyr)
#> resolution : 100, 100 (x, y)
#> extent : 695492.1, 714492.1, 6246657, 6273057 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 29N (EPSG:32629)
#> source(s) : memory
#> name : lyr.1
#> min value : 5.607983e-05
#> max value : 6.495713e-05
#>
# A SpatRaster is also acceptable
pou <- map_pou(map, .coord = coord, .plot = FALSE)$ud
#> `patter::map_pou()` called @ 2024-08-01 11:41:27...
#> ... Building XYM...
#> ... Building SpatRaster...
#> `patter::map_pou()` call ended @ 2024-08-01 11:41:27 (duration: ~0 sec(s)).
map_dens(pou)
#> `patter::map_dens()` called @ 2024-08-01 11:41:27...
#> ... 11:41:27: Processing `.map`...
#> ... 11:41:27: Building XYM...
#> ... 11:41:27: Defining `ppp` object...
#> Observation window is gridded.
#> ... 11:41:27: Estimating density surface...
#> ... 11:41:27: Scaling density surface...
#> `patter::map_dens()` call ended @ 2024-08-01 11:41:27 (duration: ~0 sec(s)).
#> $x
#> Marked planar point pattern: 5000 points
#> marks are numeric, of storage type ‘double’
#> window: binary image mask
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695492.1, 714492.1] x [6246657, 6273057] units
#>
#> $D
#> real-valued pixel image
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695490, 714490] x [6246700, 6273100] units
#>
#> $ud
#> class : SpatRaster
#> dimensions : 264, 190, 1 (nrow, ncol, nlyr)
#> resolution : 100, 100 (x, y)
#> extent : 695492.1, 714492.1, 6246657, 6273057 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 29N (EPSG:32629)
#> source(s) : memory
#> name : lyr.1
#> min value : 5.607983e-05
#> max value : 6.495713e-05
#>
#### Example (2): Use coordinates from `sim_path_walk()`
coord <- dat_path()
map_dens(map, .coord = coord)
#> `patter::map_dens()` called @ 2024-08-01 11:41:27...
#> ... 11:41:27: Processing `.map`...
#> ... 11:41:27: Building XYM...
#> ... 11:41:27: Defining `ppp` object...
#> Observation window is gridded.
#> ... 11:41:27: Estimating density surface...
#> ... 11:41:27: Scaling density surface...
#> `patter::map_dens()` call ended @ 2024-08-01 11:41:27 (duration: ~0 sec(s)).
#> $x
#> Marked planar point pattern: 360 points
#> marks are numeric, of storage type ‘double’
#> window: binary image mask
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695492.1, 714492.1] x [6246657, 6273057] units
#>
#> $D
#> real-valued pixel image
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695490, 714490] x [6246700, 6273100] units
#>
#> $ud
#> class : SpatRaster
#> dimensions : 264, 190, 1 (nrow, ncol, nlyr)
#> resolution : 100, 100 (x, y)
#> extent : 695492.1, 714492.1, 6246657, 6273057 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 29N (EPSG:32629)
#> source(s) : memory
#> name : lyr.1
#> min value : 1.629509e-17
#> max value : 9.829595e-04
#>
points(coord$x, coord$y, cex = 0.5)
#### Example (3): Use coordinates from `coa()`
# Use example dataset
coord <- dat_coa()
map_dens(map, .coord = coord)
#> `patter::map_dens()` called @ 2024-08-01 11:41:27...
#> ... 11:41:27: Processing `.map`...
#> ... 11:41:27: Building XYM...
#> ... 11:41:27: Defining `ppp` object...
#> Observation window is gridded.
#> ... 11:41:27: Estimating density surface...
#> ... 11:41:27: Scaling density surface...
#> `patter::map_dens()` call ended @ 2024-08-01 11:41:27 (duration: ~0 sec(s)).
#> $x
#> Marked planar point pattern: 6 points
#> marks are numeric, of storage type ‘double’
#> window: binary image mask
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695492.1, 714492.1] x [6246657, 6273057] units
#>
#> $D
#> real-valued pixel image
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695490, 714490] x [6246700, 6273100] units
#>
#> $ud
#> class : SpatRaster
#> dimensions : 264, 190, 1 (nrow, ncol, nlyr)
#> resolution : 100, 100 (x, y)
#> extent : 695492.1, 714492.1, 6246657, 6273057 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 29N (EPSG:32629)
#> source(s) : memory
#> name : lyr.1
#> min value : 3.389772e-18
#> max value : 8.976006e-04
#>
points(coord$x, coord$y, cex = 0.5)
#### Example (4): Use a time series of coordinates from `pf_*()`
# Use example dataset
# * We use particles from the forward filter (`?pf_filter()`);
# * Particles are equally weighted b/c re-sampling is implemented every time step;
# * It is better to use outputs from the particle smoother;
coord <- dat_pff()$states
map_dens(map, .coord = coord)
#> `patter::map_dens()` called @ 2024-08-01 11:41:27...
#> ... 11:41:27: Processing `.map`...
#> ... 11:41:27: Building XYM...
#> ... 11:41:28: Defining `ppp` object...
#> Observation window is gridded.
#> ... 11:41:28: Estimating density surface...
#> ... 11:41:28: Scaling density surface...
#> `patter::map_dens()` call ended @ 2024-08-01 11:41:28 (duration: ~1 sec(s)).
#> $x
#> Marked planar point pattern: 31298 points
#> marks are numeric, of storage type ‘double’
#> window: binary image mask
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695492.1, 714492.1] x [6246657, 6273057] units
#>
#> $D
#> real-valued pixel image
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695490, 714490] x [6246700, 6273100] units
#>
#> $ud
#> class : SpatRaster
#> dimensions : 264, 190, 1 (nrow, ncol, nlyr)
#> resolution : 100, 100 (x, y)
#> extent : 695492.1, 714492.1, 6246657, 6273057 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 29N (EPSG:32629)
#> source(s) : memory
#> name : lyr.1
#> min value : 1.787775e-17
#> max value : 9.909920e-04
#>
# points(coord$x, coord$y, cex = 0.5)
#### Example (5): Control smoothing via `spatstat.explore::density.ppp()`
# E.g. use fixed bandwidth:
map_dens(map, .coord = coord, sigma = 5)
#> `patter::map_dens()` called @ 2024-08-01 11:41:28...
#> ... 11:41:28: Processing `.map`...
#> ... 11:41:28: Building XYM...
#> ... 11:41:28: Defining `ppp` object...
#> Observation window is gridded.
#> ... 11:41:28: Estimating density surface...
#> ... 11:41:28: Scaling density surface...
#> `patter::map_dens()` call ended @ 2024-08-01 11:41:28 (duration: ~0 sec(s)).
#> $x
#> Marked planar point pattern: 31298 points
#> marks are numeric, of storage type ‘double’
#> window: binary image mask
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695492.1, 714492.1] x [6246657, 6273057] units
#>
#> $D
#> real-valued pixel image
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695490, 714490] x [6246700, 6273100] units
#>
#> $ud
#> class : SpatRaster
#> dimensions : 264, 190, 1 (nrow, ncol, nlyr)
#> resolution : 100, 100 (x, y)
#> extent : 695492.1, 714492.1, 6246657, 6273057 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 29N (EPSG:32629)
#> source(s) : memory
#> name : lyr.1
#> min value : -3.107830e-19
#> max value : 4.972285e-03
#>
map_dens(map, .coord = coord, sigma = 100)
#> `patter::map_dens()` called @ 2024-08-01 11:41:28...
#> ... 11:41:28: Processing `.map`...
#> ... 11:41:28: Building XYM...
#> ... 11:41:28: Defining `ppp` object...
#> Observation window is gridded.
#> ... 11:41:28: Estimating density surface...
#> ... 11:41:28: Scaling density surface...
#> `patter::map_dens()` call ended @ 2024-08-01 11:41:29 (duration: ~1 sec(s)).
#> $x
#> Marked planar point pattern: 31298 points
#> marks are numeric, of storage type ‘double’
#> window: binary image mask
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695492.1, 714492.1] x [6246657, 6273057] units
#>
#> $D
#> real-valued pixel image
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695490, 714490] x [6246700, 6273100] units
#>
#> $ud
#> class : SpatRaster
#> dimensions : 264, 190, 1 (nrow, ncol, nlyr)
#> resolution : 100, 100 (x, y)
#> extent : 695492.1, 714492.1, 6246657, 6273057 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 29N (EPSG:32629)
#> source(s) : memory
#> name : lyr.1
#> min value : -1.890992e-19
#> max value : 3.398141e-03
#>
# E.g., perform automatic bandwidth selection using cross validation:
map_dens(map, .coord = coord, sigma = bw.diggle)
#> `patter::map_dens()` called @ 2024-08-01 11:41:29...
#> ... 11:41:29: Processing `.map`...
#> ... 11:41:29: Building XYM...
#> ... 11:41:29: Defining `ppp` object...
#> Observation window is gridded.
#> ... 11:41:29: Estimating density surface...
#> ... 11:41:30: Scaling density surface...
#> `patter::map_dens()` call ended @ 2024-08-01 11:41:30 (duration: ~1 sec(s)).
#> $x
#> Marked planar point pattern: 31298 points
#> marks are numeric, of storage type ‘double’
#> window: binary image mask
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695492.1, 714492.1] x [6246657, 6273057] units
#>
#> $D
#> real-valued pixel image
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695490, 714490] x [6246700, 6273100] units
#>
#> $ud
#> class : SpatRaster
#> dimensions : 264, 190, 1 (nrow, ncol, nlyr)
#> resolution : 100, 100 (x, y)
#> extent : 695492.1, 714492.1, 6246657, 6273057 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 29N (EPSG:32629)
#> source(s) : memory
#> name : lyr.1
#> min value : -2.170756e-19
#> max value : 4.139222e-03
#>
map_dens(map, .coord = coord, sigma = bw.scott)
#> `patter::map_dens()` called @ 2024-08-01 11:41:30...
#> ... 11:41:30: Processing `.map`...
#> ... 11:41:30: Building XYM...
#> ... 11:41:30: Defining `ppp` object...
#> Observation window is gridded.
#> ... 11:41:30: Estimating density surface...
#> ... 11:41:31: Scaling density surface...
#> `patter::map_dens()` call ended @ 2024-08-01 11:41:31 (duration: ~1 sec(s)).
#> $x
#> Marked planar point pattern: 31298 points
#> marks are numeric, of storage type ‘double’
#> window: binary image mask
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695492.1, 714492.1] x [6246657, 6273057] units
#>
#> $D
#> real-valued pixel image
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695490, 714490] x [6246700, 6273100] units
#>
#> $ud
#> class : SpatRaster
#> dimensions : 264, 190, 1 (nrow, ncol, nlyr)
#> resolution : 100, 100 (x, y)
#> extent : 695492.1, 714492.1, 6246657, 6273057 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 29N (EPSG:32629)
#> source(s) : memory
#> name : lyr.1
#> min value : -3.956010e-19
#> max value : 2.531056e-03
#>
map_dens(map, .coord = coord, sigma = bw.ppl)
#> `patter::map_dens()` called @ 2024-08-01 11:41:31...
#> ... 11:41:31: Processing `.map`...
#> ... 11:41:31: Building XYM...
#> ... 11:41:31: Defining `ppp` object...
#> Observation window is gridded.
#> ... 11:41:31: Estimating density surface...
#> ... 11:42:02: Scaling density surface...
#> `patter::map_dens()` call ended @ 2024-08-01 11:42:02 (duration: ~31 sec(s)).
#> $x
#> Marked planar point pattern: 31298 points
#> marks are numeric, of storage type ‘double’
#> window: binary image mask
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695492.1, 714492.1] x [6246657, 6273057] units
#>
#> $D
#> real-valued pixel image
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695490, 714490] x [6246700, 6273100] units
#>
#> $ud
#> class : SpatRaster
#> dimensions : 264, 190, 1 (nrow, ncol, nlyr)
#> resolution : 100, 100 (x, y)
#> extent : 695492.1, 714492.1, 6246657, 6273057 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 29N (EPSG:32629)
#> source(s) : memory
#> name : lyr.1
#> min value : -2.338062e-19
#> max value : 4.154600e-03
#>
map_dens(map, .coord = coord, sigma = bw.CvL)
#> `patter::map_dens()` called @ 2024-08-01 11:42:02...
#> ... 11:42:02: Processing `.map`...
#> ... 11:42:02: Building XYM...
#> ... 11:42:02: Defining `ppp` object...
#> Observation window is gridded.
#> ... 11:42:02: Estimating density surface...
#> ... 11:42:22: Scaling density surface...
#> `patter::map_dens()` call ended @ 2024-08-01 11:42:22 (duration: ~20 sec(s)).
#> $x
#> Marked planar point pattern: 31298 points
#> marks are numeric, of storage type ‘double’
#> window: binary image mask
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695492.1, 714492.1] x [6246657, 6273057] units
#>
#> $D
#> real-valued pixel image
#> 264 x 190 pixel array (ny, nx)
#> enclosing rectangle: [695490, 714490] x [6246700, 6273100] units
#>
#> $ud
#> class : SpatRaster
#> dimensions : 264, 190, 1 (nrow, ncol, nlyr)
#> resolution : 100, 100 (x, y)
#> extent : 695492.1, 714492.1, 6246657, 6273057 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 29N (EPSG:32629)
#> source(s) : memory
#> name : lyr.1
#> min value : 1.593925e-07
#> max value : 3.768079e-04
#>