Create netgeom column for edges, observed sites, and/or prediction sites in a Landscape Network (LSN).

create_netgeom2(sf_data, type = NULL, overwrite = TRUE)

Arguments

sf_data

An sf object with LINESTING or POINT geometry created using link{lsn_to_ssn} (see Details).

type

Character string defining geometry type of sf_data. Default = NULL.

overwrite

Logical indicating whether existing data should be overwritten if present. Default = TRUE.

Value

An sf object containing the original data from sf_data and an additional column named netgeom.

Details

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.