我正在寻找一个匹配 GPS 坐标的工具。随附一张包含 GPS 坐标列表的表格。 https://docs.google.com/spreadsheets/d/1pCVlq7BEUBQyST0iRoPcgp_XUhUyOYjAuPQ3mfR5ehU/edit#gid=0
我尝试了数组,但无法从列中减去 1 个单元格,即使我这样做,也需要很长的方法。
您对我可以使用什么有什么建议吗? 我希望的理想情况是它检查坐标列表并突出显示多次存在的坐标,例如 300 米内。
我使用这个公式来计算两点之间的距离 = 111*SQRT((X1-X2)^2+(Y1-Y2)^2) GPS坐标的每一次变化,大约对应于地理尺度上的111公里。
最佳答案
解决方案
您可以通过在另一张工作表中创建所有点之间的距离矩阵并使用条件格式突出显示比特定距离更近的点对来检查比特定距离更近的坐标点。
实现此目的的步骤:
- 在电子表格中创建一个新工作表。
- 在第一个单元格中插入以下公式:
=ARRAYFORMULA(SQRT(POW(INDIRECT("Sheet1!$B"&(COLUMN(B2))))-Sheet1!$B2:$B340,2) + POW(INDIRECT("Sheet1!$C") “&(COLUMN(B2)))-Sheet1!$C2:$C340,2)))
Formula explanation : This formula calculates the euclidean distance between two coordinate points. I have used
ARRAY FORMULA
to automatically calculate the distance between the first point with the rest of the coordinates of your GPS signal. Note that indirect is used so that you can propagate this formula to the rest of the columns. In this case I am testing with 340 coordinate points but you can increase this as you want.
- 选择您在其中写入公式的单元格并将其拖过各列,直到达到元素总数。 (当 0 对角线到达最后一行值时,您可以轻松检查这一点)。
- 选择您的整个范围(矩阵)并转到格式 -> 条件格式,然后在用户界面中的小于或等于中选择您想要输入的距离作为极限。
通过这种方式,您将获得距离矩阵,告诉您哪些交点比特定距离更近。这是一个示例图像(距离小于 0.4):
使用的资源:
关于google-apps-script - 匹配 GPS 坐标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60971626/