diff --git a/lib/models/filter/circle.js b/lib/models/filter/circle.js index e7908d09..45b1b8a5 100644 --- a/lib/models/filter/circle.js +++ b/lib/models/filter/circle.js @@ -8,7 +8,7 @@ function filterQueryTpl ({ sql, column, srid, lng, lat, radiusInMeters } = {}) { FROM (${sql}) _cdb_circle_filter WHERE ST_DWithin( - ${srid === 3857 ? `ST_Transform(${column}, 4326)::geography` : `${column}::geography`}, + ${srid === 4326 ? `${column}::geography` : `ST_Transform(${column}, 4326)::geography`}, ST_SetSRID(ST_Point(${lng}, ${lat}), 4326)::geography, ${radiusInMeters} )