Imbedding WMS

Obviously imbedding Maps in holoviews as WMTS is possible. Is their a way to use WMS services as well? When the answer is no is it because it is just not implemented or is their a technical aspect that preclude it?

Just not implemented. Happy to see a contribution to add a WMS element to GeoViews, or if you have any funding we’d be able to find someone to implement that.

From my point of view it would be a nice extension. Especially specialist subjects are rather provided in WMS than in WMTS. I just reconized that their is an open Issue at github about it. So at least I am happy that it is on the roadmap.

Hey Sunny…Yes WMS would be great. We had a WMS Layer for an older version of Bokeh which could help. I’m thinking this would currently be best implemented as an extension to Bokeh or Geoviews.

I’ll see what I can find from the past WMS layer and see where that gets us.

1 Like

Let me know, if you have any new findings :slight_smile:

Hi,
@brendancol I think you refer to this Issue https://github.com/bokeh/bokeh/issues/7825
I took the script you optimized and adapted it for my usecase. From my point of view this approach is good to use WMS and WMTS side by side.

from bokeh.models import BBoxTileSource
import panel as pn
import holoviews as hv
pn.extension()
hv.extension('bokeh')

url = ('https://sgx.geodatenzentrum.de/wms_webatlasde.light_grau?'
        'service=wms&'
        'request=GetMap&'
        'styles=&'
        'version={version}&'
        'BGCOLOR=0xFFFFFF&'
        'format=image/png&'
        'crs={crs}&'
        'layers={layer}&'
        'width={width}&'
        'height={height}')

version = '1.3.0'
crs = 'EPSG:3857'

layer = 'webatlasde.light_grau'
width = 256
height = 256

url_set = url.format(crs=crs, width=width, height=height, layer=layer, version=version) + \
          '&bbox={XMIN},{YMIN},{XMAX},{YMAX}'

wms_source = BBoxTileSource(url=url_set)

map_dict = {'wms_source': hv.Tiles(wms_source),
            'wmts_source' : hv.Tiles('https://maps.wikimedia.org/osm-intl/{Z}/{X}/{Y}@2x.png', name="Wikipedia")}

map_select = pn.widgets.Select(options=[*map_dict])

xmin = 915699.97
ymin = 6440496.55
xmax = 932361.42
ymax = 6448651.88

xlim = (xmin,xmax)
ylim = (ymin,ymax)

@pn.depends(select = map_select, watch=True)
def map_view(select):
    return map_dict[map_select.value].opts(width = 900, height=600,
                                  xlim = xlim, ylim=ylim)

pn.serve(pn.Row(map_view, map_select), watch=True)