Example usage for org.apache.lucene.geo Polygon getHoles

List of usage examples for org.apache.lucene.geo Polygon getHoles

Introduction

In this page you can find the example usage for org.apache.lucene.geo Polygon getHoles.

Prototype

public Polygon[] getHoles() 

Source Link

Document

Returns a copy of the internal holes array

Usage

From source file:perf.IndexAndSearchOpenStreetMaps.java

License:Apache License

/** One normally need not clone a Polygon (it's a read only holder class), but we do this here just to keep the benchmark honest, by
 *  including Polygon construction cost in measuring search run time. */
private static Polygon[] clonePolygon(Polygon[] polies) {
    Polygon[] newPolies = new Polygon[polies.length];
    for (int i = 0; i < polies.length; i++) {
        Polygon poly = polies[i];
        Polygon[] holes = poly.getHoles();
        if (holes.length > 0) {
            holes = clonePolygon(holes);
        }//from w w w .  j a  va  2 s .c om
        newPolies[i] = new Polygon(poly.getPolyLats(), poly.getPolyLons(), holes);
    }
    return newPolies;
}