Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adds --update-cache flag to 'server'. #158

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cskau
Copy link

@cskau cskau commented Oct 6, 2023

TileServerHandlerhas an attribute, update_cache which is hardcoded to False.

update_cache: bool = False

This prevents the map-machine server command from serving tiles that aren't already in the cache:

if self.update_cache:
if not png_path.exists():
if not svg_path.exists():
tile.draw(
tile_path,
self.cache,
MapConfiguration(zoom_level=zoom_level),
)
with svg_path.open(encoding="utf-8") as input_file:
cairosvg.svg2png(
file_obj=input_file, write_to=str(png_path)
)
logging.info(f"SVG file is rasterized to {png_path}.")

This PR exposes update_cache as a command line flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant