Create netgeom column for edges, observed sites, and/or prediction sites in a Landscape Network (LSN).
create_netgeom2(sf_data, type = NULL, overwrite = TRUE)
An sf
object with LINESTING or POINT geometry
created using link{lsn_to_ssn}
(see Details).
Character string defining geometry type of
sf_data
. Default = NULL
.
Logical indicating whether existing data should be
overwritten if present. Default = TRUE
.
An sf
object containing the original data from
sf_data
and an additional column named netgeom.
Most users will not need to run create_netgeom2
themselves because it is called internally when lsn_to_ssn
is run or an SSN
is imported using
link[SSN2]{ssn_import}
found in the SSN2
package. For users who do wish to run create_netgeom2
, the
sf_data
object must represent edges, observed sites, or
prediction sites in a SSN
object created using
link{lsn_to_ssn}
.
The netgeom column contains information in character format used
to describe the topology of the LSN. The format and content of
the netgeom column differs depending on whether sf_data
contains LINESTRING (edges) or POINT (observed or prediction
sites) geometry. For edges, the netgeom format is:
'ENETWORK (netID, rid, upDist)'
The rid, upDist and netID columns must already be present in edges
before netgeom is added. These columns are created usining
link{lines_to_lsn}
, updist_edges
, and
link{lsn_to_ssn}
, respectively.
For observed or prediction sites, the netgeom format is:
'SNETWORK (netID, rid, upDist, ratio, pid, locID)'
The rid, ratio, upDist, netID, pid, and locID columns must be
present in sf_data
and are created using
link{sites_to_lsn}
, link{updist_sites}
, and
link{lsn_to_ssn}
, respectively.
If overwrite = TRUE
and a column named netgeom is present in
sf_data
, the data will be overwritten. Default = FALSE.