【发布时间】:2017-01-06 01:59:32
【问题描述】:
我有一个二维坐标列表,我正在从中创建kdtree。坐标类型为double- 例如[508180.748, 195333.973]
我使用 numpy 创建数组,然后使用 scipy 的 KDTree 函数。
import numpy as np
import scipy.spatial
points_array = np.array(points)
kdt = scipy.spatial.KDTree(points_array)
# Query
tester = kdt.query_pairs(20)
tester = list(tester)
print(tester[0])
这会返回:
(109139, 109144)
结果丢失了原始数据的分辨率。如何保持双精度浮点格式?
【问题讨论】: