img_tiles.py: Add Defaults 'RGBA' for 'only_streets' - #2728
Conversation
d0d5776 to
850e86a
Compare
|
😢 I think this is a rerun just like #2727 unless I'm doing something wrong? |
I think the satellite images and base layers are only opaque RGB, do you know if there is extra overhead (all 1s in alpha channel) if we request RGBA instead or does it still return RGB to us and so it doesn't really matter which request we submit? |
|
Google's tile server returns the same PNG/JPEG either way and
fh = urlopen(request)
im_data = io.BytesIO(fh.read())
fh.close()
img = Image.open(im_data)
...
img = img.convert(self.desired_tile_form)I think changing the class default to RGBA (like Stadia does) is cleaner so all styles work correctly without special-casing but I'm new to this code base so I don't know all the possible knock-on consequences. |
|
OK, so it doesn't request anything differently which is good. But the issue with opening everything as RGBA is that you then add an extra 33% in memory usage unnecessarily, so I think the |
Rationale
Fixes: #762
Code to exercise change:
Output before change
Output after change
Implications
With this setup it only affects when
style='only_streets'. It might be cleaner to just change the default itself to RGBA like below:Let me know if this is your preference.
It does look like for stadia the just set all defaults to RGBA #2269