/** Builds a Polygon2D from multipolygon */ public static Polygon2D create(Polygon... polygons) { Polygon2D components[] = new Polygon2D[polygons.length]; for (int i = 0; i < components.length; i++) { Polygon gon = polygons[i]; Polygon gonHoles[] = gon.getHoles(); Polygon2D holes = null; if (gonHoles.length > 0) { holes = create(gonHoles); } components[i] = new Polygon2D(gon, holes); } return (Polygon2D)createTree(components, 0, components.length - 1, false); }
NumericUtils.intToSortableBytes(encodeLongitude(box.maxLon), maxLon, 0); final Polygon2D tree = Polygon2D.create(polygons); final GeoEncodingUtils.PolygonPredicate polygonPredicate = GeoEncodingUtils.createPolygonPredicate(polygons, tree);
/** Builds a Polygon2D from multipolygon */ public static Polygon2D create(Polygon... polygons) { Polygon2D components[] = new Polygon2D[polygons.length]; for (int i = 0; i < components.length; i++) { Polygon gon = polygons[i]; Polygon gonHoles[] = gon.getHoles(); Polygon2D holes = null; if (gonHoles.length > 0) { holes = create(gonHoles); } components[i] = new Polygon2D(gon, holes); } return (Polygon2D)createTree(components, 0, components.length - 1, false); }
/** * Creates a query that matches all indexed shapes to the provided polygons */ XLatLonShapePolygonQuery(String field, QueryRelation queryRelation, Polygon... polygons) { super(field, queryRelation); if (polygons == null) { throw new IllegalArgumentException("polygons must not be null"); } if (polygons.length == 0) { throw new IllegalArgumentException("polygons must not be empty"); } for (int i = 0; i < polygons.length; i++) { if (polygons[i] == null) { throw new IllegalArgumentException("polygon[" + i + "] must not be null"); } else if (polygons[i].minLon > polygons[i].maxLon) { throw new IllegalArgumentException("LatLonShapePolygonQuery does not currently support querying across dateline."); } } this.polygons = polygons.clone(); this.poly2D = Polygon2D.create(polygons); }
/** * Creates a query that matches all indexed shapes to the provided polygons */ public LatLonShapePolygonQuery(String field, QueryRelation queryRelation, Polygon... polygons) { super(field, queryRelation); if (polygons == null) { throw new IllegalArgumentException("polygons must not be null"); } if (polygons.length == 0) { throw new IllegalArgumentException("polygons must not be empty"); } for (int i = 0; i < polygons.length; i++) { if (polygons[i] == null) { throw new IllegalArgumentException("polygon[" + i + "] must not be null"); } else if (polygons[i].minLon > polygons[i].maxLon) { throw new IllegalArgumentException("LatLonShapePolygonQuery does not currently support querying across dateline."); } } this.polygons = polygons.clone(); this.poly2D = Polygon2D.create(polygons); }
NumericUtils.intToSortableBytes(encodeLongitude(box.maxLon), maxLon, 0); final Polygon2D tree = Polygon2D.create(polygons); final GeoEncodingUtils.PolygonPredicate polygonPredicate = GeoEncodingUtils.createPolygonPredicate(polygons, tree);