[英]In PostGIS which one is the most accurate way to calculate distance between two points?
I'm having problems with st_distance function in postgis. 我在postgis中遇到st_distance函数问题。 I have three ways to calculate the distance, but I don't know which one is the most accurate.
我有三种计算距离的方法,但我不知道哪一种最准确。
SELECT ST_Distance('POINT(115.25 39.26)'::geography, 'POINT(117.30 41.04)'::geography) as distance;
--result is 263753.911823565
SELECT ST_Distance_Sphere(ST_GeomFromText('POINT(115.25 39.26)',4326), ST_GeomFromText('POINT(117.30 41.04)',4326)) as distance;
--result is 263674.468686404
SELECT ST_Distance( ST_Transform(ST_GeomFromText('POINT(115.25 39.26)',4326),32650),ST_Transform(ST_GeomFromText('POINT(117.30 41.04)', 4326),32650)) as distance;
--result is 263669.651755417
The difference between the 3 measurement calculations is the following: 3次测量计算之间的差异如下:
The first method usually gives the best result (of these 3), but for coordinates that are close together or close to the Equator, the difference would be negligible compared to the faster second method. 第一种方法通常给出最好的结果(这3种),但对于靠近或接近赤道的坐标,与更快的第二种方法相比,差异可以忽略不计。
The third method is not particularly accurate with the UTM50N(WGS84) coordinate reference system, but a cartesian coordinate system has important other benefits, such as calculating angles between triplets of points or areas of polygons. 第三种方法对于UTM50N(WGS84)坐标参考系统并不是特别准确,但是笛卡尔坐标系具有重要的其他好处,例如计算点的三元组或多边形区域之间的角度。 Also note that some datums in use with local CRSes give a much better local representation of the earth's irregular surface than WGS84 does, in which case a local CRS becomes much more accurate than a great-arc calculation.
还要注意,与WGS84相比,使用局部CRS的一些基准给出了地球不规则表面的更好的局部表示,在这种情况下,局部CRS变得比大弧计算更准确。 You would have to look up all the geodetic details of your area to assess that.
您必须查找您所在区域的所有大地测量细节才能对其进行评估。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.