我需要执行下面的代码,但我在下面类型不匹配:不能从列表转换为Object []
public int getNearestNeighbour(Point point) {
int result = 0;
try {
Object[] nearestPoint = kdtree.nearest(point.toDouble(), 2);
result = (Integer)nearestPoint[1];
} catch(Exception e) {
debug(e);
result = -1;
}
return result;
}
'nearest'返回'List'。不要指望'Object []'。 –
什么是'kdtree'? “最近”的方法在哪里? –
KDtree是一个执行JAR文件,它包含最近的方法以返回给定点的最近点。我尝试了许多转换从列表转换为对象,但它不工作...请告诉我 – mumenh