The function domain is generic,
with methods for many classes.
For a spatial object X
domain(X) extracts the spatial domain in which X is
defined.
For a two-dimensional object X, typically domain(X)
is the same as Window(X).
The exception is that, if X is a point pattern on a linear network
(class "lpp") or a point process model on a linear network
(class "lppm"), then domain(X) is the linear network
on which the points lie, while Window(X) is the two-dimensional
window containing the linear network.