Example usage for com.google.common.geometry S2Loop isValid

List of usage examples for com.google.common.geometry S2Loop isValid

Introduction

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

Prototype

public boolean isValid() 

Source Link

Document

Return true if this loop is valid.

Usage

From source file:com.bc.fiduceo.geometry.s2.BcS2Polygon.java

@Override
public boolean isValid() {
    final int numLoops = googlePolygon.numLoops();
    final ArrayList<S2Loop> loops = new ArrayList<>();
    for (int i = 0; i < numLoops; i++) {
        final S2Loop loop = googlePolygon.loop(i);
        if (!loop.isValid()) {
            return false;
        }//from w  w w  . j  a  va2  s .c  o  m
        loops.add(loop);
    }

    return S2Polygon.isValid(loops);
}