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

Tiles attribution not showing when using custom tile server #765

Open
ernhollam opened this issue Nov 5, 2024 · 1 comment
Open

Tiles attribution not showing when using custom tile server #765

ernhollam opened this issue Nov 5, 2024 · 1 comment

Comments

@ernhollam
Copy link

ALL software version info

Software Version Info
bokeh                     3.5.2           py311h746a85d_0
cartopy                   0.22.0          py311h786e728_0
geoviews                  1.13.0          py311haa95532_0
geoviews-core             1.13.0          py311haa95532_0
holoviews                 1.19.1          py311haa95532_0
numpy                     1.26.4          py311hdab7c0b_0

Description of expected behavior and the observed behavior

When adding tile in geoviews, I expect the attribution of the underlying Bokeh model to show at the bottom right corner of the map, just like with any built-in tile server. However, it is not the case when I'm using custom tile server such as the French one. I think this might be a bug.
(Discussed at discourse post)

Complete, minimal, self-contained example code that reproduces the issue

from bokeh.plotting import figure, show
from bokeh.io import output_notebook
from bokeh.models import WMTSTileSource

output_notebook()

import cartopy.crs as ccrs
import numpy as np

import geoviews as gv
gv.extension('bokeh')

x_bounds=(2.14572, 2.61568)
y_bounds=(48.68763, 49.01233)
google_mercator_bbox = ccrs.GOOGLE_MERCATOR.transform_points(
        ccrs.PlateCarree(), x=np.array(x_bounds), y=np.array(y_bounds)
    )[:, :-1].flatten()

PLANIGNV2_tile_provider = WMTSTileSource(url="https://data.geopf.fr/tms/1.0.0/GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2/{Z}/{X}/{Y}.png",
                              name='PLAN IGN',
                              attribution=""" <a href="https://www.ign.fr/" target="_blank">&copy; IGN</a> maps""",
                              max_zoom=19)

# This shows the attributions at the bottom of the map
plan_ign_v2 = figure(x_range=(google_mercator_bbox[0], google_mercator_bbox[2]),
                     y_range=(google_mercator_bbox[1], google_mercator_bbox[3]),
                     min_width=800, min_height=400,
                     x_axis_type='mercator', y_axis_type='mercator',
                     active_drag='pan', active_scroll='wheel_zoom', match_aspect=True)
plan_ign_v2.add_tile(local_PLANIGNV2_tile_provider)
show(plan_ign_v2)

# The attribution is not visible using gv.WMTS()
gv.WMTS(PLANIGNV2_tile_provider).opts(active_tools=['wheel_zoom'], min_height=500, min_width=800,
                              xlim=(google_mercator_bbox[0], google_mercator_bbox[2]),
                     ylim=(google_mercator_bbox[1], google_mercator_bbox[3]))

# However it's there with the built-in OSM tile sources
gv.tile_sources.OSM().opts(active_tools=['wheel_zoom'], min_height=500, min_width=800,
                              xlim=(google_mercator_bbox[0], google_mercator_bbox[2]),
                     ylim=(google_mercator_bbox[1], google_mercator_bbox[3]))

Screenshots

Attributions shows with figure.add_tile()
gv.WMTS() with custom tile server
gv.tile_sources.OSM()

@holovizbot
Copy link

This issue has been mentioned on HoloViz Discourse. There might be relevant details there:

https://discourse.holoviz.org/t/tiles-attribution-not-showing-when-using-custom-tiles-server-with-gv-wmts/8367/3

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

No branches or pull requests

2 participants