protected StringBuilder getWhereClause(final int pZoom,
                                           final Collection<Rect> pInclude,
                                           final Collection<Rect> pExclude) {
        final StringBuilder buffer = new StringBuilder();
        buffer.append('(');
        buffer.append(getWhereClause(pZoom, null));
        if (pInclude != null && pInclude.size() > 0) {
            buffer.append(" and (");
            String coordinator = "";
            for (final Rect rect : pInclude) {
                buffer.append(coordinator).append('(').append(getWhereClause(pZoom, rect)).append(')');
                coordinator = " or ";
            }
            buffer.append(")");
        }
        if (pExclude != null && pExclude.size() > 0) {
            buffer.append(" and not(");
            String coordinator = "";
            for (final Rect rect : pExclude) {
                buffer.append(coordinator).append('(').append(getWhereClause(pZoom, rect)).append(')');
                coordinator = " or ";
            }
            buffer.append(")");
        }
        buffer.append(')');
        return buffer;
    }
protected StringBuilder getWhereClause ( final int pZoom , final Collection < Rect > pInclude , final Collection < Rect > pExclude ) { final StringBuilder buffer = new StringBuilder ( ) ; buffer . append ( '(' ) ; buffer . append ( getWhereClause ( pZoom , null ) ) ; if ( pInclude != null && pInclude . size ( ) > 0 ) { buffer . append ( " and (" ) ; String coordinator = "" ; for ( final Rect rect : pInclude ) { buffer . append ( coordinator ) . append ( '(' ) . append ( getWhereClause ( pZoom , rect ) ) . append ( ')' ) ; coordinator = " or " ; } buffer . append ( ")" ) ; } if ( pExclude != null && pExclude . size ( ) > 0 ) { buffer . append ( " and not(" ) ; String coordinator = "" ; for ( final Rect rect : pExclude ) { buffer . append ( coordinator ) . append ( '(' ) . append ( getWhereClause ( pZoom , rect ) ) . append ( ')' ) ; coordinator = " or " ; } buffer . append ( ")" ) ; } buffer . append ( ')' ) ; return buffer ; }
@since 6.0.2
@return the part of a SQL where clause used to restrict the selected tiles to
- a zoom
- a collection of bounding boxes to include (possibly null/empty)
- a collection of bounding boxes to exclude (possibly null/empty)