File: point.in.polygon.Rd

package info (click to toggle)
r-cran-sp 1:0.9-66-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,696 kB
  • ctags: 123
  • sloc: ansic: 1,475; sh: 6; makefile: 5
file content (35 lines) | stat: -rw-r--r-- 1,232 bytes parent folder | download | duplicates (2)
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
\name{point.in.polygon}
\alias{point.in.polygon}
\title{ do point(s) fall in a given polygon? }
\description{
verifies for one or more points whether they fall in a given polygon
}
\usage{
point.in.polygon(point.x, point.y, pol.x, pol.y, mode.checked=FALSE)
}
\arguments{
\item{point.x}{numerical array of x-coordinates of points}
\item{point.y}{numerical array of y-coordinates of points}
\item{pol.x}{numerical array of x-coordinates of polygon}
\item{pol.y}{numerical array of y-coordinates of polygon}
\item{mode.checked}{default FALSE, used internally to save time when all the other argument are known to be of storage mode double}
}
\value{ integer array; values are:
0: point is strictly exterior to pol;
1: point is strictly interior to pol;
2: point lies on the relative interior of an edge of pol;
3: point is a vertex of pol.
}
\references{ 
Uses the C function InPoly(), in gstat file polygon.c;
InPoly is Copyright (c) 1998 by Joseph O'Rourke.  It may be freely
redistributed in its entirety provided that this copyright notice is
not removed.
}
\examples{
# open polygon:
point.in.polygon(1:10,1:10,c(3,5,5,3),c(3,3,5,5))
# closed polygon:
point.in.polygon(1:10,rep(4,10),c(3,5,5,3,3),c(3,3,5,5,3))
}
\keyword{manip}