segvert2xy: Convert River Locations to XY coordinates

View source: R/riverdist_1.R

segvert2xyR Documentation

Convert River Locations to XY coordinates

Description

This function is almost the reverse of xy2segvert, and returns a data frame of the XY spatial coordinates corresponding to vectors of segment and vertex. It should be noted that this only returns the spatial coordinates from the river network itself, and will not necessarily correspond to the original set of point data.

Usage

segvert2xy(seg, vert, rivers)

Arguments

seg

A vector of river segments to transform

vert

A vector of river vertices to transform

rivers

The river network object to use

Value

A data frame of XY coordinates, given as $snap_x and $snap_y..

Author(s)

Matt Tyers

See Also

xy2segvert, pointshp2segvert

Examples

data(Gulk,fakefish)
head(fakefish)

xy_from_segvert <- segvert2xy(seg=fakefish$seg, vert=fakefish$vert, 
                   rivers=Gulk)
head(xy_from_segvert)

plot(x=Gulk, xlim=c(862000,882000), ylim=c(6978000,6993000))
points(x=fakefish$x, y=fakefish$y, pch=16, col=2)

points(x=xy_from_segvert$snap_x, y=xy_from_segvert$snap_y, pch=15, col=4)

riverdist documentation built on April 12, 2025, 2:24 a.m.