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

Preset Stamen tile file extension, opacity #2202

Merged
merged 3 commits into from
Jun 29, 2023

Conversation

lgolston
Copy link
Contributor

@lgolston lgolston commented Jun 29, 2023

Rationale

In issue #2198 it was pointed out the Stamen watercolor tiles can not be downloaded currently as png. Right now, all the layers are downloaded as png and also default to RGB mode. This PR creates a dictionary to set the file extension automatically (specifically using jpg for watercolor) and desired_tile_form to RGBA for known layers which should have a transparent background (like terrain-lines).

Implications

Stamen watercolor feature should be working again, and behavior of behavior of non-opaque layers improved. By explicitly listing the known Stamen layers in a dict, this also may help the user be aware of the available options.

@lgolston lgolston changed the title Variable Stamen tile file extension, opacity Preset Stamen tile file extension, opacity Jun 29, 2023
@lgolston
Copy link
Contributor Author

The initial commit ignored the optional desired_tile_form input parameter, which is now fixed. I believe the code is ready for review.

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.

Minor nit, but otherwise this looks great!

lib/cartopy/io/img_tiles.py Outdated Show resolved Hide resolved
Co-authored-by: Ryan May <rmay31@gmail.com>
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.

Test failures look unrelated so going to merge.

@dopplershift dopplershift merged commit 97b0675 into SciTools:main Jun 29, 2023
@dopplershift dopplershift added this to the 0.21.2 milestone Jun 29, 2023
@lgolston lgolston deleted the stamen-tiles branch July 18, 2023 16:22
@greglucas greglucas modified the milestones: 0.21.2, 0.22 Jul 26, 2023
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.

3 participants