This function basically facilitates the use of
terra::distance
on a PresenceAbsence
object, allowing also
the user to have directly a dist
object. The distance is always
expressed in meter if the coordinate reference system is
longitude/latitude, and in map units otherwise. Map units are typically
meter, but inspect crs(x) if in doubt.