如何计算椭圆体外壳与R中的点之间的最小距离
how to calculate minimum distance between an ellipsoid hull and a point in R
我将 R 中的 ellipsoidhull() 函数应用于一组 latlong 点。从那里我试图找到那个椭圆体和一个新的经纬度点之间的最小距离。到目前为止,我有下面的代码,但它肯定是不完整的。感谢任何帮助,谢谢。
df <- cbind(A$lat, A$long)
ellipse <- ellipsoidhull(df)
point <- (28.5,-81.2)
distance <- spDistsN1(ellipse, point, longlat = FALSE)
我可能找到了答案,虽然不准确。我缺少预测功能,所以:
df <- cbind(A$lat, A$long)
ellipsePoints <- ellipsoidhull(df)
ellipse <- predict(ellipsePoints)
ellipse <- cbind(ellipse$longpts,ellipse$latpts)
point <- (longpt,latpt)
distance <- spDistsN1(ellipse, point, longlat = FALSE)
if anyone else has a more accurate way please let me know, thank you.
我将 R 中的 ellipsoidhull() 函数应用于一组 latlong 点。从那里我试图找到那个椭圆体和一个新的经纬度点之间的最小距离。到目前为止,我有下面的代码,但它肯定是不完整的。感谢任何帮助,谢谢。
df <- cbind(A$lat, A$long)
ellipse <- ellipsoidhull(df)
point <- (28.5,-81.2)
distance <- spDistsN1(ellipse, point, longlat = FALSE)
我可能找到了答案,虽然不准确。我缺少预测功能,所以:
df <- cbind(A$lat, A$long)
ellipsePoints <- ellipsoidhull(df)
ellipse <- predict(ellipsePoints)
ellipse <- cbind(ellipse$longpts,ellipse$latpts)
point <- (longpt,latpt)
distance <- spDistsN1(ellipse, point, longlat = FALSE)
if anyone else has a more accurate way please let me know, thank you.