Skip to content

Commit

Permalink
Trying to add tile filitering
Browse files Browse the repository at this point in the history
  • Loading branch information
underbluewaters committed Oct 21, 2024
1 parent 8d5652e commit 1354988
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/h3-filter-ingest/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ const server = createServer(async (req, res) => {
res.setHeader("Access-Control-Allow-Origin", "*");
res.end("Filter is required");
}
const rootTile = parsedUrl.searchParams.get("tile");
if (resolution < 11) {
const f = buildWhereClauses(filters || {}, 1);
console.time("query");
Expand All @@ -203,6 +204,13 @@ const server = createServer(async (req, res) => {
cells
where
${f.values.length > 0 ? f.where : "true"}
${
rootTile
? `AND r${h3.getResolution(
rootTile
)}_id = h3_string_to_h3('${rootTile}')`
: ""
}
)
select
h3_compact_cells(
Expand Down

0 comments on commit 1354988

Please sign in to comment.