Example usage for com.google.common.geometry S2Point equals

List of usage examples for com.google.common.geometry S2Point equals

Introduction

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

Prototype

@Override
    public boolean equals(Object that) 

Source Link

Usage

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

@Override
public Polygon createPolygon(List<Point> points) {
    final List<S2Point> loopPoints = extractS2Points(points);
    final S2Point first = loopPoints.get(0);
    final int lastIndex = loopPoints.size() - 1;
    final S2Point last = loopPoints.get(lastIndex);
    if (first.equals(last)) {
        loopPoints.remove(lastIndex);//  w  ww  . ja  v a  2s .  co m
    }

    final S2Loop s2Loop = new S2Loop(loopPoints);

    final S2Polygon googlePolygon = new S2Polygon(s2Loop);
    return new BcS2Polygon(googlePolygon);
}

From source file:com.bc.geometry.s2.S2WKTReader.java

private List<S2Point> getMultiPolygonPoints() throws IOException, IllegalArgumentException {
    ArrayList<S2Point> points = new ArrayList<>();
    points.add(getPreciseCoordinate());/*from   ww  w.  j av  a2  s  .  c  o m*/
    String nextToken = getNextCloserOrComma();
    while (COMMA.equals(nextToken)) {
        points.add(getPreciseCoordinate());
        nextToken = getNextCloserOrComma();
    }
    final S2Point first = points.get(0);
    final int lastIndex = points.size() - 1;
    final S2Point last = points.get(lastIndex);
    if (first.equals(last)) {
        points.remove(lastIndex);
    }
    return points;
}