@Override
  public final String getSqlPredicat() {
    if (this.isPolesCollision()) {
      return null;
    }

    final List ranges = (List) computeRange();
    final List<Double[]> raRanges = (List<Double[]>) ranges.get(0);
    final double[] decRange = (double[]) ranges.get(1);

    String predicatDefinition;
    if (isNorthPoleCollision()) {
      LOG.log(Level.FINEST, "North collision case");
      predicatDefinition = String.format(" AND (spoly_overlap_polygon(%s,'{(%sd,%sd),(%sd,%sd),(%sd,%sd)}')", geomCol, 0.0, decRange[0], 45.0, 90.0, 90.0, decRange[0]);
      predicatDefinition = predicatDefinition.concat(String.format(" OR spoly_overlap_polygon(%s,'{(%sd,%sd),(%sd,%sd),(%sd,%sd)}')", geomCol, 90.0, decRange[MIN], 135.0, 90.0, 180.0, decRange[MIN]));
      predicatDefinition = predicatDefinition.concat(String.format(" OR spoly_overlap_polygon(%s,'{(%sd,%sd),(%sd,%sd),(%sd,%sd)}')", geomCol, 180.0, decRange[MIN], 225.0, 90.0, 270.0, decRange[MIN]));
      predicatDefinition = predicatDefinition.concat(String.format(" OR spoly_overlap_polygon(%s,'{(%sd,%sd),(%sd,%sd),(%sd,%sd)}'))", geomCol, 270.0, decRange[MIN], 325.0, 90.0, 360.0, decRange[MIN]));
      LOG.log(Level.FINEST, predicatDefinition);

    } else if (isSouthPoleCollision()) {
      LOG.log(Level.FINEST, "South collision case");
      predicatDefinition = String.format(" AND (spoly_overlap_polygon(%s,'{(%sd,%sd),(%sd,%sd),(%sd,%sd)}')", geomCol, 0.0, decRange[MAX], 45.0, -90.0, 90.0, decRange[MAX]);
      predicatDefinition = predicatDefinition.concat(String.format(" OR spoly_overlap_polygon(%s,'{(%sd,%sd),(%sd,%sd),(%sd,%sd)}')", geomCol, 90.0, decRange[MAX], 135.0, -90.0, 180.0, decRange[MAX]));
      predicatDefinition = predicatDefinition.concat(String.format(" OR spoly_overlap_polygon(%s,'{(%sd,%sd),(%sd,%sd),(%sd,%sd)}')", geomCol, 180.0, decRange[MAX], 225.0, -90.0, 270.0, decRange[MAX]));
      predicatDefinition = predicatDefinition.concat(String.format(" OR spoly_overlap_polygon(%s,'{(%sd,%sd),(%sd,%sd),(%sd,%sd)}'))", geomCol, 270.0, decRange[MAX], 325.0, -90.0, 360.0, decRange[MAX]));
      LOG.log(Level.FINEST, predicatDefinition);

    } else if (isRing()) {
      LOG.log(Level.FINEST, "Ring case");
      predicatDefinition = String.format(" AND (spoly_overlap_polygon(%s,'{(%sd,%sd),(%sd,%sd),(%sd,%sd), (%sd,%sd)}')", geomCol, 0.0, decRange[MIN], 90.0, decRange[MIN], 90.0, decRange[MAX], 0.0, decRange[MAX]);
      predicatDefinition = predicatDefinition.concat(String.format(" OR spoly_overlap_polygon(%s,'{(%sd,%sd),(%sd,%sd),(%sd,%sd), (%sd,%sd)}')", geomCol, 90.0, decRange[MIN], 180.0, decRange[MIN], 180.0, decRange[MAX], 90.0, decRange[MAX]));
      predicatDefinition = predicatDefinition.concat(String.format(" OR spoly_overlap_polygon(%s,'{(%sd,%sd),(%sd,%sd),(%sd,%sd), (%sd,%sd)}')", geomCol, 180.0, decRange[MIN], 270.0, decRange[MIN], 270.0, decRange[MAX], 180.0, decRange[MAX]));
      predicatDefinition = predicatDefinition.concat(String.format(" OR spoly_overlap_polygon(%s,'{(%sd,%sd),(%sd,%sd),(%sd,%sd), (%sd,%sd)}'))", geomCol, 270.0, decRange[MIN], 0.0, decRange[MIN], 0.0, decRange[MAX], 270.0, decRange[MAX]));
      LOG.log(Level.FINEST, predicatDefinition);

    } else if (raRanges.size() == 1 && isLargePolygon()) {
      LOG.log(Level.FINEST, "Large polygon case");
      final Double[] raRange1 = raRanges.get(0);
      final double mean = (raRange1[MIN] + raRange1[MAX]) / 2.0;
      raRanges.add(new Double[]{mean, raRange1[MAX]});
      raRanges.set(0, new Double[]{raRange1[MIN], mean});
      predicatDefinition = buildMultiPolygon(raRanges, decRange);
      LOG.log(Level.FINEST, predicatDefinition);
    } else {
      LOG.log(Level.FINEST, "other case");
      predicatDefinition = buildMultiPolygon(raRanges, decRange);
      LOG.log(Level.FINEST, predicatDefinition);
    }
    return predicatDefinition;
  }