List of usage examples for org.apache.lucene.geo Polygon Polygon
public Polygon(double[] polyLats, double[] polyLons, Polygon... holes)
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); }// w ww .j a v a 2 s . c o m newPolies[i] = new Polygon(poly.getPolyLats(), poly.getPolyLons(), holes); } return newPolies; }