Example usage for com.google.common.geometry S2Cell getVertexRaw

List of usage examples for com.google.common.geometry S2Cell getVertexRaw

Introduction

In this page you can find the example usage for com.google.common.geometry S2Cell getVertexRaw.

Prototype

public S2Point getVertexRaw(int k) 

Source Link

Document

Return the k-th vertex of the cell (k = 0,1,2,3).

Usage

From source file:org.apache.lucene.spatial.spatial4j.Geo3dShapeFactory.java

@Override
public Shape getS2CellShape(S2CellId cellId) {
    S2Cell cell = new S2Cell(cellId);
    GeoPoint point1 = getGeoPoint(cell.getVertexRaw(0));
    GeoPoint point2 = getGeoPoint(cell.getVertexRaw(1));
    GeoPoint point3 = getGeoPoint(cell.getVertexRaw(2));
    GeoPoint point4 = getGeoPoint(cell.getVertexRaw(3));
    return new Geo3dShape<>(GeoS2ShapeFactory.makeGeoS2Shape(planetModel, point1, point2, point3, point4),
            context);/*from  ww  w.  j  a  v  a2 s  .  co m*/
}