Description Usage Arguments Value Author(s) References See Also Examples
This function creates and writes a shapefile object from traced streams. If present, further stream metadata will be exported as shapefile attributes as well.
1 | write.stream(stream, filename, segments = FALSE, projection)
|
stream |
(list object) Stream object to be exported. This must be a list
object of only one timestep from |
filename |
(character scalar) Name of the output file, with extension. |
segments |
(logical) Option to create stream individual segments (all lines between nodes as separate objects) or merged objects (all lines between nodes as one stream object), default is FALSE. |
projection |
The geographic projection of the output file. If not specified, the exported data set will not have any reference. |
A shapefile with stream courses and thematic stream data.
Michael Dietze
CSDMS website. http://csdms.colorado.edu/wiki/Model:CHILD.
Tucker, GE. 2010. CHILD Users Guide for version R9.4.1.
http://csdms.colorado.edu/mediawiki/images/Child_users_guide.pdf
Tucker, GE., Lancaster, ST., Gasparini, NM., Bras, RL. 2001. The
Channel-Hillslope Integrated Landscape Development (CHILD) Model.
In Harmon, RS., Doe, W.W. III (eds). Landscape Erosion and Evolution
Modeling. Kluwer Academic/Plenum Publishers, pp. 349-388.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # load example data set
data(hillslope1)
# trace two streams from different starting points through two time steps
startpoints <- cbind(c(50, 100), c(120, 100))
streams <- trace.stream(dataset = hillslope1,
timestep = 2:3,
startpoints = startpoints)
# extract the first time step as source data for shapefile export
streams_export <- streams[[1]]
# write the streams into a shapefile and save it
write.stream(stream = streams_export,
filename = "streams.shp",
segments = TRUE,
projection = "+proj=lcc +lat_1=48 +lat_2=33 +lon_0=-100 +ellps=WGS84")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.