nearestsegment(spatstat)
nearestsegment()所属R语言包:spatstat
Find Line Segment Nearest to Each Point
查找到每个点最近的线段
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Given a point pattern and a line segment pattern, this function finds the nearest line segment for each point.
给定一个点图案和线段图案,此功能找到最接近的每个点的线段。
用法----------Usage----------
nearestsegment(X, Y)
参数----------Arguments----------
参数:X
A point pattern (object of class "ppp").
点模式(类的对象"ppp")。
参数:Y
A line segment pattern (object of class "psp").
一个线段模式(类的对象"psp")。
Details
详细信息----------Details----------
The distance between a point x and a straight line segment y is defined to be the shortest Euclidean distance between x and any location on y. This algorithm first calculates the distance from each point of X to each segment of Y. Then it determines, for each point x in X, which segment of Y is closest. The index of this segment is returned.
之间的距离,点x和直线段y被定义为最短的欧几里得距离之间的x上的任何位置y。该算法首先计算出每个点的X各分部的Y的距离。然后确定,每个点的x中X,Y最接近的部分。这部分的索引返回。
值----------Value----------
Integer vector v (of length equal to the number of points in X) identifying the nearest segment to each point. If v[i] = j, then Y[j] is the line segment lying closest to X[i].
整数向量v(长度等于到的点的数量在X)识别每个点最接近段的。如果v[i] = j,那么Y[j]是的线段上最接近X[i]。
(作者)----------Author(s)----------
Adrian Baddeley
<a href="mailto:Adrian.Baddeley@csiro.au">Adrian.Baddeley@csiro.au</a>
<a href="http://www.maths.uwa.edu.au/~adrian/">http://www.maths.uwa.edu.au/~adrian/</a>
and Rolf Turner
<a href="mailto:r.turner@auckland.ac.nz">r.turner@auckland.ac.nz</a>
参见----------See Also----------
project2segment to project each point of X to a point lying on one of the line segments.
project2segment的X项目的每一个点到一个点的线段躺在。
Use distmap.psp to identify the nearest line segment for each pixel in a grid.
使用distmap.psp,以确定在一个网格中的每个像素最接近的线段。
实例----------Examples----------
X <- runifpoint(3)
Y <- as.psp(matrix(runif(20), 5, 4), window=owin())
v <- nearestsegment(X,Y)
plot(Y)
plot(X, add=TRUE)
plot(X[1], add=TRUE, col="red")
plot(Y[v[1]], add=TRUE, lwd=2, col="red")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|