Skip to content

Commit 2eca280

Browse files
authored
Switch from 'grid_width' to 'grid_width_meters'
1 parent 8311154 commit 2eca280

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

queries.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ post_process:
10521052
end_zoom: 9
10531053
items_matching: { kind: locality }
10541054
max_items: 1
1055-
grid_width: 52181.0113
1055+
grid_width_meters: 52181.0113
10561056
sorting_keys:
10571057
- { sort_key: 'min_zoom', reverse: False }
10581058
- { sort_key: 'collision_rank', reverse: False }
@@ -1065,7 +1065,7 @@ post_process:
10651065
end_zoom: 10
10661066
items_matching: { kind: locality }
10671067
max_items: 1
1068-
grid_width: 26090.5056
1068+
grid_width_meters: 26090.5056
10691069
sorting_keys:
10701070
- { sort_key: 'min_zoom', reverse: False }
10711071
- { sort_key: 'collision_rank', reverse: False }
@@ -1078,7 +1078,7 @@ post_process:
10781078
end_zoom: 11
10791079
items_matching: { kind: locality }
10801080
max_items: 1
1081-
grid_width: 13045.2528
1081+
grid_width_meters: 13045.2528
10821082
sorting_keys:
10831083
- { sort_key: 'min_zoom', reverse: False }
10841084
- { sort_key: 'collision_rank', reverse: False }
@@ -1091,7 +1091,7 @@ post_process:
10911091
end_zoom: 12
10921092
items_matching: { kind: locality }
10931093
max_items: 1
1094-
grid_width: 6522.1264
1094+
grid_width_meters: 6522.1264
10951095
sorting_keys:
10961096
- { sort_key: 'min_zoom', reverse: False }
10971097
- { sort_key: 'collision_rank', reverse: False }
@@ -1104,7 +1104,7 @@ post_process:
11041104
end_zoom: 13
11051105
items_matching: { kind: locality }
11061106
max_items: 1
1107-
grid_width: 3261.0632
1107+
grid_width_meters: 3261.0632
11081108
sorting_keys:
11091109
- { sort_key: 'min_zoom', reverse: False }
11101110
- { sort_key: 'collision_rank', reverse: False }

vectordatasource/transform.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3122,9 +3122,10 @@ def keep_n_features_gridded(ctx):
31223122
pairs in `items_matching` into a grid, then keep the
31233123
first `max_items` features in each grid cell.
31243124
3125-
The grid is created by dividing the bounds into buckets.
3126-
The `grid_width` and `grid_height` params specify the
3127-
width and height (in projected units) of each bucket.
3125+
The grid is created by dividing the bounds into cells.
3126+
The `grid_width_meters` and `grid_height_meters` params
3127+
specify the width and height (in mercator meters) of
3128+
each grid cell.
31283129
31293130
NOTE: This only works with point features and will
31303131
pass through non-point features untouched.
@@ -3141,9 +3142,10 @@ def keep_n_features_gridded(ctx):
31413142
end_zoom = ctx.params.get('end_zoom')
31423143
items_matching = ctx.params.get('items_matching')
31433144
max_items = ctx.params.get('max_items')
3144-
grid_width = ctx.params.get('grid_width')
3145-
# if grid_height is not specified, use grid_width for grid_height
3146-
grid_height = ctx.params.get('grid_height') or grid_width
3145+
grid_width = ctx.params.get('grid_width_meters')
3146+
# if grid_height_meters is not specified, use grid_width_meters
3147+
# for grid_height_meters
3148+
grid_height = ctx.params.get('grid_height_meters') or grid_width
31473149
sorting_keys = ctx.params.get('sorting_keys')
31483150

31493151
# leaving items_matching, grid_size, or max_items as None (or zero)

0 commit comments

Comments
 (0)