Skip to content

Commit 87ada41

Browse files
author
Sean Sullivan
committed
Change bucket filter to log space since the datashader is in log space
1 parent 75f080d commit 87ada41

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

elastic_datashader/tilegen.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,8 +1132,9 @@ def generate_tile(idx, x, y, z, headers, params, tile_width_px=256, tile_height_
11321132
estimated_points_per_tile = resp.aggregations.comp.buckets[0].sum['value']
11331133
else:
11341134
estimated_points_per_tile = resp.aggregations.comp.buckets[0].doc_count
1135-
min_bucket = estimated_points_per_tile*params['bucket_min']
1136-
max_bucket = estimated_points_per_tile*params['bucket_max']
1135+
1136+
min_bucket = math.exp(math.log(estimated_points_per_tile)*params['bucket_min'])
1137+
max_bucket = math.exp(math.log(estimated_points_per_tile)*params['bucket_max'])
11371138
geo_tile_grid.pipeline("selector","bucket_selector",buckets_path={"doc_count":"_count"},script=f"params.doc_count > {min_bucket} && params.doc_count < {max_bucket}")
11381139
logger.info(geo_tile_grid.to_dict())
11391140
if inner_aggs is not None:

0 commit comments

Comments
 (0)