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

Add a simple local file cache for img_tiles. #795

Closed
wants to merge 2 commits into from

Conversation

aeroevan
Copy link

This should close #732. This is probably a common enough use case to be included as an option.

Geotiler also includes a redis cache which could easily be added here.

Cache implementation using shelve.

If appdirs is available, the proper user_cache_dir for the system will
be used, otherwise the current working directory will be used.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that's the best place; there's a config setting that might be a better default.

@aeroevan aeroevan force-pushed the feature/img_tiles_cache branch 2 times, most recently from 101f9fa to 6c1833a Compare March 2, 2017 03:30
@aeroevan aeroevan force-pushed the feature/img_tiles_cache branch from 6c1833a to 0a62adb Compare March 15, 2017 02:57
@manugarri
Copy link
Contributor

what is the status of this PR? Looks like it would be an excellent use case for me. I use jupyter notebooks to tweak plots and I sometimes run the same bounding box with the same tiles dozens of times while I test the different aestethics of the visualization. Caching would be ideal in this case

@pelson pelson added Type: Enhancement SemVer: minor Blocked: CLA needed See https://scitools.org.uk. Submit the form at: https://scitools.org.uk/cla/v4/form labels Feb 7, 2018
Copy link
Contributor

@dopplershift dopplershift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will also need a CLA in place before this goes in, if there's still interest.

pass


class ShelveTileCache(TileCache):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given how easy duck typing is in Python, I would eliminate the TileCache base class

I would also say we should just implement __getitem__ and __setitem__ to make the interface more Pythonic. Or at least that's my inclination.

@greglucas
Copy link
Contributor

This was superseded by #1533, closing for now, but feel free to reopen if you think there is something else to be done here still.

@greglucas greglucas closed this Nov 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked: CLA needed See https://scitools.org.uk. Submit the form at: https://scitools.org.uk/cla/v4/form SemVer: minor Type: Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Local cache for Open Street Map tiles
6 participants