Skip to content

Commit

Permalink
Move default max zoom 16 to a constants module (#389)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored Mar 3, 2023
1 parent fe2578e commit 7dd1998
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ v2.5.0
* 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)
* 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)
* 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)
* Move default "max zoom" of 16 to a constants module. [PR #389](https://github.com/tilezen/tilequeue/pull/389)
* Clarify with inline docs that "meters per pixel" assumes a 256-pixel nominal extent. [PR #408](https://github.com/tilezen/tilequeue/pull/408)
* Add linters for YAML, JSON, and Python to the repo. [PR #403](https://github.com/tilezen/tilequeue/pull/403)
* 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)
Expand All @@ -24,7 +25,6 @@ v2.4.1-final
* 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)
* Add more logging for performance tuning. [PR #390](https://github.com/tilezen/tilequeue/pull/392) and others.


v2.4.0
------

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.0
2.5.0
2 changes: 1 addition & 1 deletion tilequeue/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -2159,7 +2159,7 @@ def tilequeue_meta_tile(cfg, args):
'Unexpected zoom: %s, zoom should be between %d and %d' % \
(coord_str, queue_zoom, group_by_zoom)

# NOTE: max_zoom looks to be inclusive
# NOTE: max_zoom looks to be inclusive but zoom_stop is exclusive so pay attention the confusing names here
zoom_stop = cfg.max_zoom
assert zoom_stop > group_by_zoom
formats = lookup_formats(cfg.output_formats)
Expand Down
3 changes: 2 additions & 1 deletion tilequeue/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from yaml import load

from tilequeue.constants import MAX_TILE_ZOOM
from tilequeue.tile import bounds_buffer
from tilequeue.tile import metatile_zoom_from_size

Expand Down Expand Up @@ -337,7 +338,7 @@ def default_yml_config():
'expired-location': None,
'parent-zoom-until': None,
},
'max-zoom-with-changes': 16,
'max-zoom-with-changes': MAX_TILE_ZOOM,
},
'toi-store': {
'type': None,
Expand Down
1 change: 1 addition & 0 deletions tilequeue/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MAX_TILE_ZOOM = 16 # tilezen's default max supported zoom
4 changes: 2 additions & 2 deletions tilequeue/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from tilequeue import utils
from tilequeue.config import create_query_bounds_pad_fn
from tilequeue.constants import MAX_TILE_ZOOM
from tilequeue.log import make_coord_dict
from tilequeue.tile import calc_meters_per_pixel_dim
from tilequeue.tile import coord_to_mercator_bounds
Expand Down Expand Up @@ -389,8 +390,7 @@ def process_coord_no_format(
assert min_zoom is not None, \
'Missing min_zoom in layer %s' % layer_name

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

for k, v in output_props.items():
Expand Down

0 comments on commit 7dd1998

Please sign in to comment.