Example usage for com.google.common.geometry S2CellUnion S2CellUnion

List of usage examples for com.google.common.geometry S2CellUnion S2CellUnion

Introduction

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

Prototype

public S2CellUnion() 

Source Link

Usage

From source file:com.amazonaws.geo.s2.internal.S2Manager.java

public static S2CellUnion findCellIds(S2LatLngRect latLngRect) {

    ConcurrentLinkedQueue<S2CellId> queue = new ConcurrentLinkedQueue<S2CellId>();
    ArrayList<S2CellId> cellIds = new ArrayList<S2CellId>();

    for (S2CellId c = S2CellId.begin(0); !c.equals(S2CellId.end(0)); c = c.next()) {
        if (containsGeodataToFind(c, latLngRect)) {
            queue.add(c);/*from  w  w  w .  ja  va2s  . c o m*/
        }
    }

    processQueue(queue, cellIds, latLngRect);
    assert queue.size() == 0;
    queue = null;

    if (cellIds.size() > 0) {
        S2CellUnion cellUnion = new S2CellUnion();
        cellUnion.initFromCellIds(cellIds); // This normalize the cells.
        // cellUnion.initRawCellIds(cellIds); // This does not normalize the cells.
        cellIds = null;

        return cellUnion;
    }

    return null;
}

From source file:org.esa.beam.occci.S2IEoProduct.java

private static S2CellUnion createS2CellUnion(String cellIdString) {
    StringTokenizer st = new StringTokenizer(cellIdString, ";");
    ArrayList<S2CellId> cellIds = new ArrayList<S2CellId>();
    while (st.hasMoreTokens()) {
        cellIds.add(new S2CellId(Long.parseLong(st.nextToken())));
    }//from   w ww  .  jav a2s . c  o  m
    S2CellUnion cellUnion = new S2CellUnion();
    cellUnion.initRawCellIds(cellIds);
    return cellUnion;
}

From source file:org.esa.beam.occci.S2IEoProduct.java

private S2CellUnion createS2CellUnion(ArrayList<S2CellId> cellIds) {
    S2CellUnion cellUnion = new S2CellUnion();
    cellUnion.initRawCellIds(cellIds);
    return cellUnion;
}