/** Returns relation to the provided rectangle */ public Relation relate(double minLat, double maxLat, double minLon, double maxLon) { if (minLat <= maxY && minLon <= maxX) { Relation relation = internalComponentRelate(minLat, maxLat, minLon, maxLon); if (relation != Relation.CELL_OUTSIDE_QUERY) { return relation; } if (left != null) { relation = left.relate(minLat, maxLat, minLon, maxLon); if (relation != Relation.CELL_OUTSIDE_QUERY) { return relation; } } if (right != null && ((splitX == false && maxLat >= this.minLat) || (splitX && maxLon >= this.minLon))) { relation = right.relate(minLat, maxLat, minLon, maxLon); if (relation != Relation.CELL_OUTSIDE_QUERY) { return relation; } } } return Relation.CELL_OUTSIDE_QUERY; }
/** Returns relation to the provided rectangle */ public Relation relate(double minLat, double maxLat, double minLon, double maxLon) { if (minLat <= maxY && minLon <= maxX) { Relation relation = internalComponentRelate(minLat, maxLat, minLon, maxLon); if (relation != Relation.CELL_OUTSIDE_QUERY) { return relation; } if (left != null) { relation = left.relate(minLat, maxLat, minLon, maxLon); if (relation != Relation.CELL_OUTSIDE_QUERY) { return relation; } } if (right != null && ((splitX == false && maxLat >= this.minLat) || (splitX && maxLon >= this.minLon))) { relation = right.relate(minLat, maxLat, minLon, maxLon); if (relation != Relation.CELL_OUTSIDE_QUERY) { return relation; } } } return Relation.CELL_OUTSIDE_QUERY; }