sdcpol takes a set of line segments, finds where they meet and
assembles the polygons they enclose. It works on a plain table of
segments rather than on a tda_spatial structure, and with
option = 3 it writes a spatial data file the rest of the family
can read.
Usage
tda_polygons(segments, option = 3, dir = tempfile("tda"), ...)Arguments
- segments
a data frame of four columns: the two ends of each segment, as x1, y1, x2, y2.
- option
1 prints the node list of the graph the segments form, 2 its edge list, 3 constructs the polygons.
- dir
working directory for the run.
- ...
further options for
sdcpol;tolis the tolerance for treating two points as the same, default 1e-4.
See also
Other spatial analysis:
plot.tda_spatial(),
tda_map(),
tda_read_dbf(),
tda_read_shapefile(),
tda_read_spatial,
tda_sd(),
tda_sd_analyses,
tda_sd_ps3(),
tda_spatial()
Examples
sq <- data.frame(x1 = c(0, 1, 1, 0), y1 = c(0, 0, 1, 1),
x2 = c(1, 1, 0, 0), y2 = c(0, 1, 1, 0))
tda_polygons(sq)
#> TDA spatial data (poly.sd)
#> (no summary in the reader's output; see $run$output)