diff --git a/lib/torque/provider/filterableJson.js b/lib/torque/provider/filterableJson.js index 9d30daf..ecd5cb0 100644 --- a/lib/torque/provider/filterableJson.js +++ b/lib/torque/provider/filterableJson.js @@ -424,8 +424,11 @@ var Profiler = require('../profiler'); "and (((quadkey_y & (255 << {shift})) >> {shift}) - {torque_tile_y}) between -{tolerance} and {tolerance} " ] - if(applyFilters) { - sql.push("and (" + this._generateFiltersSQL(false) + ")"); + if (applyFilters) { + var f = this._generateFiltersSQL(false); + if (f.length) { + sql.push("and (" + f + ")"); + } } sql.push("limit {maxNo}");