List of usage examples for com.google.common.geometry S2CellId fromFacePosLevel
public static S2CellId fromFacePosLevel(int face, long pos, int level)
From source file:org.geosde.cassandra.GeometryTestCase.java
/** * Return a random cell id at the given level or at a randomly chosen level. * The distribution is uniform over the space of cell ids, but only * approximately uniform over the surface of the sphere. *///w ww. j av a2 s . c om public S2CellId getRandomCellId(int level) { int face = random(S2CellId.NUM_FACES); long pos = rand.nextLong() & ((1L << (2 * S2CellId.MAX_LEVEL)) - 1); return S2CellId.fromFacePosLevel(face, pos, level); }