Skip to content

Commit 7dd1998

Browse files
peitilinvkelsopre-commit-ci[bot]
authored
Move default max zoom 16 to a constants module (#389)
* Move max zoom 16 to a constants module * bump version to v2.5.0 --------- Co-authored-by: Nathaniel Kelso <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent fe2578e commit 7dd1998

File tree

6 files changed

+8
-6
lines changed

6 files changed

+8
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ v2.5.0
99
* Add trimming of overzoom features from tiles where they're not needed (related to "max zoom" and overzooming, especially to drop address points in buildings layer and some kinds in the pois layer). [PR #402](https://github.com/tilezen/tilequeue/pull/402)
1010
* Add support for preprocessed inline geojson layers, paired with [vector-datasource/2095](https://github.com/tilezen/vector-datasource/pull/2095). [PR #414](https://github.com/tilezen/tilequeue/pull/414)
1111
* Set the MVT resolution (extent) to 4096 pixels instead of 8192 in most circumstances to save file size. [PR #404](https://github.com/tilezen/tilequeue/pull/404)
12+
* Move default "max zoom" of 16 to a constants module. [PR #389](https://github.com/tilezen/tilequeue/pull/389)
1213
* Clarify with inline docs that "meters per pixel" assumes a 256-pixel nominal extent. [PR #408](https://github.com/tilezen/tilequeue/pull/408)
1314
* Add linters for YAML, JSON, and Python to the repo. [PR #403](https://github.com/tilezen/tilequeue/pull/403)
1415
* Update requirements.txt to pin boto3 and botocore to make it easier to assume an S3 role. [PR #416](https://github.com/tilezen/tilequeue/pull/416)
@@ -24,7 +25,6 @@ v2.4.1-final
2425
* Add comma as character to put in quotes to smooth import of Who's On First neighbourhoods. [PR #400](https://github.com/tilezen/tilequeue/pull/400)
2526
* Add more logging for performance tuning. [PR #390](https://github.com/tilezen/tilequeue/pull/392) and others.
2627

27-
2828
v2.4.0
2929
------
3030

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.0
1+
2.5.0

tilequeue/command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2159,7 +2159,7 @@ def tilequeue_meta_tile(cfg, args):
21592159
'Unexpected zoom: %s, zoom should be between %d and %d' % \
21602160
(coord_str, queue_zoom, group_by_zoom)
21612161

2162-
# NOTE: max_zoom looks to be inclusive
2162+
# NOTE: max_zoom looks to be inclusive but zoom_stop is exclusive so pay attention the confusing names here
21632163
zoom_stop = cfg.max_zoom
21642164
assert zoom_stop > group_by_zoom
21652165
formats = lookup_formats(cfg.output_formats)

tilequeue/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from yaml import load
44

5+
from tilequeue.constants import MAX_TILE_ZOOM
56
from tilequeue.tile import bounds_buffer
67
from tilequeue.tile import metatile_zoom_from_size
78

@@ -337,7 +338,7 @@ def default_yml_config():
337338
'expired-location': None,
338339
'parent-zoom-until': None,
339340
},
340-
'max-zoom-with-changes': 16,
341+
'max-zoom-with-changes': MAX_TILE_ZOOM,
341342
},
342343
'toi-store': {
343344
'type': None,

tilequeue/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MAX_TILE_ZOOM = 16 # tilezen's default max supported zoom

tilequeue/process.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from tilequeue import utils
1919
from tilequeue.config import create_query_bounds_pad_fn
20+
from tilequeue.constants import MAX_TILE_ZOOM
2021
from tilequeue.log import make_coord_dict
2122
from tilequeue.tile import calc_meters_per_pixel_dim
2223
from tilequeue.tile import coord_to_mercator_bounds
@@ -389,8 +390,7 @@ def process_coord_no_format(
389390
assert min_zoom is not None, \
390391
'Missing min_zoom in layer %s' % layer_name
391392

392-
# TODO would be better if 16 wasn't hard coded here
393-
if nominal_zoom < 16 and min_zoom >= nominal_zoom + 1:
393+
if nominal_zoom < MAX_TILE_ZOOM and min_zoom >= nominal_zoom + 1:
394394
continue
395395

396396
for k, v in output_props.items():

0 commit comments

Comments
 (0)