Home
last modified time | relevance | path

Searched refs:S2Cell (Results 1 – 18 of 18) sorted by relevance

/external/s2-geometry-library-java/src/com/google/common/geometry/
DS2Cell.java26 public final strictfp class S2Cell implements S2Region { class
39 S2Cell() { in S2Cell() method in S2Cell
46 public S2Cell(S2CellId id) { in S2Cell() method in S2Cell
51 public static S2Cell fromFacePosLevel(int face, byte pos, int level) { in fromFacePosLevel()
52 return new S2Cell(S2CellId.fromFacePosLevel(face, pos, level)); in fromFacePosLevel()
56 public S2Cell(S2Point p) { in S2Cell() method in S2Cell
60 public S2Cell(S2LatLng ll) { in S2Cell() method in S2Cell
130 public boolean subdivide(S2Cell children[]) { in subdivide()
144 S2Cell child = children[pos]; in subdivide()
259 S2Cell clone = new S2Cell(); in clone()
[all …]
DS2RegionCoverer.java65 private static final S2Cell[] FACE_CELLS = new S2Cell[6];
68 FACE_CELLS[face] = S2Cell.fromFacePosLevel(face, (byte) 0, 0);
99 private S2Cell cell;
326 private Candidate newCandidate(S2Cell cell) { in newCandidate()
411 private int expandChildren(Candidate candidate, S2Cell cell, int numLevels) { in expandChildren()
413 S2Cell[] childCells = new S2Cell[4]; in expandChildren()
415 childCells[i] = new S2Cell(); in expandChildren()
461 addCandidate(newCandidate(new S2Cell(base.get(i)))); in getInitialCandidates()
531 if (!region.mayIntersect(new S2Cell(id))) { in floodFill()
DS2CellUnion.java213 public boolean contains(S2Cell cell) { in contains()
424 double area = S2Cell.averageArea(id.level()); in getCapBound()
439 cap = cap.addCap(new S2Cell(id).getCapBound()); in getCapBound()
448 bound = bound.union(new S2Cell(id).getRectBound()); in getRectBound()
456 public boolean mayIntersect(S2Cell cell) { in mayIntersect()
499 return S2Cell.averageArea(S2CellId.MAX_LEVEL) * leafCellsCovered(); in averageBasedArea()
511 area += new S2Cell(cellId).approxArea(); in approxArea()
525 area += new S2Cell(cellId).exactArea(); in exactArea()
DS2Region.java43 public abstract boolean contains(S2Cell cell); in contains()
50 public abstract boolean mayIntersect(S2Cell cell); in mayIntersect()
DS2EdgeIndex.java470 private static boolean edgeIntersectsCellBoundary(S2Point a, S2Point b, S2Cell cell) { in edgeIntersectsCellBoundary()
496 S2Cell[] children = null; in getEdgesInChildrenCells()
512 children = new S2Cell[4]; in getEdgesInChildrenCells()
514 children[i] = new S2Cell(); in getEdgesInChildrenCells()
517 new S2Cell(cell).subdivide(children); in getEdgesInChildrenCells()
518 for (S2Cell child : children) { in getEdgesInChildrenCells()
DS2Cap.java296 public boolean contains(S2Cell cell) { in contains()
315 public boolean mayIntersect(S2Cell cell) { in mayIntersect()
331 public boolean intersects(S2Cell cell, S2Point[] vertices) { in intersects()
DS2Polyline.java167 public boolean contains(S2Cell cell) { in contains()
178 public boolean mayIntersect(S2Cell cell) { in mayIntersect()
DS2Loop.java113 public S2Loop(S2Cell cell) { in S2Loop()
124 public S2Loop(S2Cell cell, S2LatLngRect bound) { in S2Loop()
590 public boolean contains(S2Cell cell) { in contains()
609 public boolean mayIntersect(S2Cell cell) { in mayIntersect()
DS2LatLngRect.java384 public boolean intersects(S2Cell cell) { in intersects()
636 public boolean contains(S2Cell cell) { in contains()
650 public boolean mayIntersect(S2Cell cell) { in mayIntersect()
DS2Polygon.java876 public boolean contains(S2Cell cell) { in contains()
896 public boolean mayIntersect(S2Cell cell) { in mayIntersect()
/external/s2-geometry-library-java/tests/com/google/common/geometry/
DS2CellTest.java32 S2Cell cell = new S2Cell(id); in testFaces()
112 static void gatherStats(S2Cell cell) { in gatherStats()
163 public void testSubdivide(S2Cell cell) { in testSubdivide()
169 S2Cell[] children = new S2Cell[4]; in testSubdivide()
171 children[i] = new S2Cell(); in testSubdivide()
186 S2Cell direct = new S2Cell(childId); in testSubdivide()
350 testSubdivide(S2Cell.fromFacePosLevel(face, (byte) 0, 0)); in testSubdivide()
378 s.maxApproxRatio, S2Cell.averageArea(i) / s.maxArea, S2Cell in testSubdivide()
424 public void expandChildren1(S2Cell cell) { in expandChildren1()
425 S2Cell[] children = new S2Cell[4]; in expandChildren1()
[all …]
DS2LatLngRectTest.java44 public void testCellOps(S2LatLngRect r, S2Cell cell, int level) { in testCellOps()
213 testCellOps(empty, S2Cell.fromFacePosLevel(3, (byte) 0, 0), 0); in testBasic()
214 testCellOps(full, S2Cell.fromFacePosLevel(2, (byte) 0, 0), 4); in testBasic()
215 testCellOps(full, S2Cell.fromFacePosLevel(5, (byte) 0, 25), 4); in testBasic()
220 testCellOps(r4, S2Cell.fromFacePosLevel(0, (byte) 0, 0), 3); in testBasic()
221 testCellOps(r4, S2Cell.fromFacePosLevel(0, (byte) 0, 1), 4); in testBasic()
222 testCellOps(r4, S2Cell.fromFacePosLevel(1, (byte) 0, 1), 0); in testBasic()
226 testCellOps(r5, S2Cell.fromFacePosLevel(0, (byte) 0, 0), 3); in testBasic()
227 testCellOps(r5, S2Cell.fromFacePosLevel(0, (byte) 0, 1), 3); in testBasic()
228 testCellOps(r5, S2Cell.fromFacePosLevel(1, (byte) 0, 1), 0); in testBasic()
[all …]
DS2RegionCovererTest.java35 coverer.getCovering(new S2Cell(id), covering.cellIds()); in testRandomCells()
68 assertTrue(region.contains(new S2Cell(covering.get(i)))); in checkCovering()
90 4 * S2.M_PI, (3 * coverer.maxCells() + 1) * S2Cell.averageArea(coverer.minLevel())); in testRandomCaps()
91 S2Cap cap = getRandomCap(0.1 * S2Cell.averageArea(kMaxLevel), maxArea); in testRandomCaps()
129 double maxArea = Math.min(4 * S2.M_PI, 1000 * S2Cell.averageArea(level)); in testSimpleCoverings()
130 S2Cap cap = getRandomCap(0.1 * S2Cell.averageArea(kMaxLevel), maxArea); in testSimpleCoverings()
DS2CellUnionTest.java52 S2Cell face1Cell = new S2Cell(face1Id); in testBasic()
53 S2Cell face2Cell = new S2Cell(face2Id); in testBasic()
185 assertTrue(cap.contains(new S2Cell(cellunion.cellId(k)))); in testNormalize()
300 S2Cell cell = new S2Cell(covering.cellId(i)); in getMaxAngle()
318 S2Cap cap = getRandomCap(S2Cell.averageArea(S2CellId.MAX_LEVEL), 4 * S2.M_PI); in testExpand()
407 double expected = S2Cell.averageArea(S2CellId.MAX_LEVEL) * (1L + (1L << 58)); in testAverageBasedArea()
422 double expected = new S2Cell(ids.get(0)).approxArea() + new S2Cell(ids.get(1)).approxArea(); in testApproxArea()
437 double expected = new S2Cell(ids.get(0)).exactArea() + new S2Cell(ids.get(1)).exactArea(); in testExactArea()
DS2CapTest.java177 S2Cell rootCell = S2Cell.fromFacePosLevel(face, (byte) 0, 0); in testCells()
180 S2Cell edgeCell = new S2Cell(S2Projections.faceUvToXyz(face, 0, 1 - EPS)); in testCells()
183 S2Cell cornerCell = new S2Cell(S2Projections.faceUvToXyz(face, 1 - EPS, 1 - EPS)); in testCells()
195 S2Cell cell = new S2Cell(id); in testCells()
DGeometryTestCase.java115 if (!region.mayIntersect(new S2Cell(id))) {
125 assertTrue(!region.contains(new S2Cell(id)));
DS2PolylineTest.java75 S2Cell cell = S2Cell.fromFacePosLevel(face, (byte) 0, 0);
DS2LoopTest.java213 S2Cell cell = new S2Cell(id); in testContains()
248 S2Cell cell = new S2Cell(id); in makeCellLoop()