Convert Polylines into a Polygon
Convert two polylines into a polygon.
convLP (polyA, polyB, reverse = TRUE)
The resulting PolySet contains all the vertices from
polyA
in their original order. If reverse = TRUE
, this
function appends the vertices from polyB
in the reverse order
(nrow(polyB):1
). Otherwise, it appends them in their original
order. The PID
column equals the PID
of polyA
.
No SID
column appears in the result. The resulting polygon is
an exterior boundary.
PolySet with a single PID
that is the same as
polyA
. The result contains all the vertices in polyA
and
polyB
. It has the same projection
and zone
attributes as those in the input PolySets. If an input PolySet's
attributes equal NULL
, the function uses the other
PolySet's. If the PolySet attributes conflict, the result's attribute
equals NULL
.
Nicholas M. Boers, Associate Professor – Computer Science
MacEwan University, Edmonton AB
Last modified Rd: 2013-04-10
local(envir=.PBSmapEnv,expr={ oldpar = par(no.readonly=TRUE) #--- create two polylines polyline1 <- data.frame(PID=rep(1,2),POS=1:2,X=c(1,4),Y=c(1,4)) polyline2 <- data.frame(PID=rep(1,2),POS=1:2,X=c(2,5),Y=c(1,4)) #--- create two plots to demonstrate the effect of `reverse' par(mfrow=c(2, 1)) plotPolys(convLP(polyline1, polyline2, reverse=TRUE), col=2) plotPolys(convLP(polyline1, polyline2, reverse=FALSE), col=3) par(oldpar) })
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.