File: makepoly.Rd

package info (click to toggle)
r-cran-geosphere 1.5-7-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,312 kB
  • sloc: ansic: 1,789; makefile: 2
file content (41 lines) | stat: -rw-r--r-- 1,167 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
\name{makePoly}

\alias{makePoly}
\alias{makeLine}
  
\title{Add vertices to a polygon or line}

\description{
Make a polygon or line by adding intermedate points (vertices) on the great circles inbetween the points supplied. This can be relevant when vertices are relatively far apart. 
It can make the shape of the object to be accurate, when plotted on a plane. \code{makePoly} will also close the polygon if needed.
}

\usage{
makePoly(p, interval=10000, sp=FALSE, ...)
makeLine(p, interval=10000, sp=FALSE, ...)
}

\arguments{
\item{p}{a 2-column matrix (longitude/latitude) or a SpatialPolygons or SpatialLines object}
\item{interval}{maximum interval of points, in units of r}
\item{sp}{Logical. If \code{TRUE}, a SpatialPolygons object is retunred (depends on the 'sp' package)}
\item{...}{additional arguments passed to distGeo}  
}


\value{
A matrix 
}

\author{Robert J. Hijmans }

\examples{
pol <- rbind(c(-180,-20), c(-160,5), c(-60, 0), c(-160,-60), c(-180,-20))
plot(pol)
lines(pol, col='red', lwd=3)
pol2 = makePoly(pol, interval=100000)
lines(pol2, col='blue', lwd=2)
}

\keyword{methods}
\keyword{spatial}