Skip to content

Commit

Permalink
fix(tiler): fix query where clause for unclustered server
Browse files Browse the repository at this point in the history
  • Loading branch information
bartolkaruza committed Oct 23, 2019
1 parent aa15196 commit da3b72b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions js/createClusterQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ const unclusteredQuery = ({
geometry,
resolution,
attributes,
query
}) =>
`
WITH filtered AS
(SELECT ${table}.${geometry} ${attributesToSelect(attributes)}
FROM ${table}
WHERE ST_Intersects(TileBBox(${z}, ${x}, ${y}, 3857), ST_Transform(${table}.${geometry}, 3857))
${query.length > 0 ? `AND ${query.join(' AND ')}` : ''}
),
q as
(SELECT 1 as c1,
Expand Down Expand Up @@ -177,6 +179,7 @@ export function createQueryForTile({
geometry,
resolution,
attributes,
query
});
// console.log(ret);
return ret;
Expand Down
2 changes: 1 addition & 1 deletion js/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default async function Server({
geometry,
resolution,
attributes,
query: urlQueryToSql(query)
query: urlQueryToSql(query),
})
);

Expand Down

0 comments on commit da3b72b

Please sign in to comment.