segvert2xy | R Documentation |
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.
segvert2xy(seg, vert, rivers)
seg |
A vector of river segments to transform |
vert |
A vector of river vertices to transform |
rivers |
The river network object to use |
A data frame of XY coordinates, given as $snap_x
and $snap_y
..
Matt Tyers
xy2segvert, pointshp2segvert
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.