バケット ID を検索する関数にencoder.getBucketIndices()
は、入力値の double または string が必要です。
ただし、経度と緯度、および別の 2 倍の速度を含むの入力値ですGeospatialCoordinateEncoder
。bucket[]
これらの問題を解決するにはどうすればよいですか?
コードは次のとおりです。
public int[] getBucketIndices(double input) {}
public int[] getBucketIndices(String input) {}
問題は、GeospatialCoordinateEncoder の入力値が次のとおりであることです。
int[] encoding1 = encode(ge, new double[] { -122.229194, 37.486782 }, speed);// ge is GeospatialCoordinateEncoder
public int[] encode(CoordinateEncoder encoder, double[] coordinate, double radius) {
int[] output = new int[encoder.getWidth()];// return n/** number of bits in the representation (must be >= w) */
encoder.encodeIntoArray(new Tuple(coordinate[0], coordinate[1], radius), output);
return output;//
}
バケット ID の取得関数
int bucketIdx = encoder.getBucketIndices(value)[0];