distance(SDMTools)
distance()所属R语言包:SDMTools
Vincenty Direct Calculation of Distance and Direction
Vincenty直接计算距离和方向
译者:生物统计家园网 机器人LoveR
描述----------Description----------
distance estimates the distance given a starting & ending latitude and longitude. <br> <br> For general information on Vincenty's formula, see e.g., http://en.wikipedia.org/wiki/Vincenty's_formulae. It states: <br> Vincenty's formulae are two related iterative methods used in geodesy to calculate the distance between two points on the surface of an spheroid, developed by Thaddeus Vincenty in 1975. They are based on the assumption that the figure of the Earth is an oblate spheroid, and hence are more accurate than methods such as great-circle distance which assume a spherical Earth. <br> <br> Note: this method assumes a locations are lat & lon given in WGS 84.<br><br> Direction, if requested, is the the initial bearing (sometimes referred to as forward azimuth) for which one would follow as a straight line along a great-circle arc from start to finish.<br> <br> Note: this will fail if there are NA's in the data.
distance估计的开始和结束的经度和纬度的距离。参考<BR>的一般信息Vincenty的公式,见例如,http://en.wikipedia.org/wiki/Vincenty“s_formulae。它指出:参考Vincenty的公式是两个相关的迭代方法用于大地测量,计算,1975由赛迪斯 - Vincenty开发中的球体表面上两点之间的距离。它们是基于地球的数字是一个扁球体的假设,因此,更准确的方法相比,如大圆距离假设球形地球。 <br> <br>注意:此方法假定一个位置在WGS 84的纬度和经度。方向<BR> <BR>,如果有要求,是初始轴承,(有时也被称为前进方位)哪一个将遵循一个伟大的圆弧沿直线从开始到结束。<br> <br>请注意:这将失败,如果有NA的数据。
用法----------Usage----------
distance(lat1, lon1=NULL, lat2=NULL, lon2=NULL, bearing=FALSE)
参数----------Arguments----------
参数:lat1
a single value or vector of values representing latitude in decimal degrees from -90 to 90 degrees. Alternatively, a data.frame or matrix can be used here with each column representing lat1, lon1, lat2, lon2 (in that order).
一个单一的值或矢量的值,从-90度到90度以十进制度表示纬度。另外,数据框或矩阵可以用在这里,每一列代表LAT1,lon1,LAT2,lon2(按顺序)。
参数:lon1
a single value or vector of values representing longitude in decimal degrees from -180 to 180 degrees. If NULL, lat1 is assumed to be a matrix or data.frame.
一个单一的值或矢量的值表示十进制度从-180到180度经度。如果为NULL,LAT1被假定为一个矩阵或数据框。
参数:lat2
a single value or vector of values representing latitude in decimal degrees from -90 to 90 degrees. If NULL, lat1 is assumed to be a matrix or data.frame.
一个单一的值或矢量的值,从-90度到90度以十进制度表示纬度。如果为NULL,LAT1被假定为一个矩阵或数据框。
参数:lon2
a single value or vector of values representing longitude in decimal degrees from -180 to 180 degrees. If NULL, lat1 is assumed to be a matrix or data.frame.
一个单一的值或矢量的值表示十进制度从-180到180度经度。如果为NULL,LAT1被假定为一个矩阵或数据框。
参数:bearing
boolean value as to calculate the direction as well as the distance.
布尔值,以计算的方向,以及在距离。
值----------Value----------
Returns a data.frame with:
返回一个数据框:
参数:lon1
the original longitude
原来的经度
参数:lat1
the original latitude
原来的纬度
参数:lon2
the destination longitude
目的地经度
参数:lat2
the destination latitude
目的地纬度
参数:distance
the distance used
距离
参数:bearing
if requested, the bearing between the two points
如果被请求的,这两个点之间的轴承
(作者)----------Author(s)----------
Jeremy VanDerWal <a href="mailto:jjvanderwal@gmail.com">jjvanderwal@gmail.com</a>
源----------Source----------
The source code for the distance algorithm here was modified from http://www.movable-type.co.uk/scripts/latlong-vincenty.html.<br> <br> Distances were validated against Geoscience Australia calculations (http://www.ga.gov.au/geodesy/datums/vincenty_inverse.jsp).<br> <br> Bearings were from multiple sources including http://williams.best.vwh.net/avform.htm#Crs.
这里距离算法的源代码被修改从http://www.movable-type.co.uk/scripts/latlong-vincenty.html。<BR> <BR>距离进行了验证对澳大利亚地球科学计算(呻参考参考/ www.ga.gov.au /大地测量/基准/ vincenty_inverse.jsp)的轴承是从多个数据源,包括http://williams.best.vwh.net/avform.htm#CRS。
参考文献----------References----------
<h3>See Also</h3>
实例----------Examples----------
#get the distance of 1 degree longitude at each 5 degrees latitude from -90 to 90[在每个北纬5度,1度经线的距离从-90到90]
distance(lat1=seq(-90,90,5),lon1=rep(0,37),lat2=seq(-90,90,5),lon2=rep(1,37),bearing=TRUE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|