Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.

Commit 88e8eb7

Browse files
committed
fix: add cql_filter in thumbnail print
1 parent 1d84c33 commit 88e8eb7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/core/print.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import json
33
import random
44
from typing import Dict, List, Union
5+
from urllib.parse import quote
56

67
import aiohttp
78
import matplotlib.pyplot as plt
@@ -567,12 +568,20 @@ async def create_project_thumbnail(
567568
# Transform style
568569
style = transform_to_mapbox_layer_style_spec(layer.dict())
569570

571+
cql_filter = ""
572+
573+
if layer.query and layer.query.cql:
574+
json_cql_str = json.dumps(layer.query.cql)
575+
cql_filter = f"?filter={quote(json_cql_str)}"
576+
570577
# Add layer source
571578
tile_url = (
572579
f"{settings.GOAT_GEOAPI_HOST}/collections/"
573580
+ collection_id
574581
+ "/tiles/{z}/{x}/{y}"
582+
+ cql_filter
575583
)
584+
576585
map.addSource(
577586
layer.name,
578587
json.dumps(

0 commit comments

Comments
 (0)