Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/geoviews/micromatch-…
Browse files Browse the repository at this point in the history
…4.0.8
  • Loading branch information
hoxbro committed Sep 16, 2024
2 parents 45e8898 + 391bf0f commit 04c8c0a
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 7 deletions.
18 changes: 17 additions & 1 deletion examples/user_guide/Working_with_Bokeh.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"metadata": {},
"outputs": [],
"source": [
"gts.EsriImagery.opts(width=600, height=570, global_extent=True) * gts.StamenLabels.options(level='annotation')"
"gts.EsriImagery.opts(width=600, height=570, global_extent=True) * gts.StamenLabels.opts(level='annotation')"
]
},
{
Expand All @@ -95,6 +95,22 @@
"gv.util.get_tile_rgb(tiles, bbox=(-180, -70, 180, 70), zoom_level=1).opts(width=500, height=500, projection=ccrs.Orthographic())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Note, that a `max_zoom` default is set for some tile sources; if you need a more detailed map, and the tile source supports it, you can increase this value. However, if the tile source does not support the requested zoom level, the tile source could return tiles that are empty or tiles that note \"map data not yet available\", depending on how the tile source handles those requests."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"gts.EsriImagery.opts(max_zoom=30)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
4 changes: 2 additions & 2 deletions geoviews/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion geoviews/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@holoviz/geoviews",
"version": "1.13.0-rc.1",
"version": "1.13.0-rc.3",
"description": "Simple, concise geographical visualization in Python",
"license": "BSD-3-Clause",
"repository": {
Expand Down
20 changes: 19 additions & 1 deletion geoviews/plotting/bokeh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@
project_quadmesh,
project_vectorfield,
)
from ...tile_sources import _ATTRIBUTIONS
from ...tile_sources import (
_ATTRIBUTIONS,
ESRI,
OSM,
EsriImagery,
EsriNatGeo,
EsriWorldHillshade,
)
from ...util import line_types, poly_types
from . import callbacks # noqa
from .plot import GeoOverlayPlot, GeoPlot
Expand All @@ -60,6 +67,15 @@
class ImageStackPlot:
...

_TILE_MAX_ZOOM = {
OSM: 19,
ESRI: 19,
EsriImagery: 19,
EsriNatGeo: 16,
EsriWorldHillshade: 16,
}


class TilePlot(GeoPlot):

style_opts = [
Expand Down Expand Up @@ -102,6 +118,8 @@ def get_data(self, element, ranges, style):
'Must contain {X}/{Y}/{Z}, {XMIN}/{XMAX}/{YMIN}/{YMAX} '
'or {Q} template strings.')
params = {'url': element.data}
if element in _TILE_MAX_ZOOM:
params['max_zoom'] = _TILE_MAX_ZOOM[element]
for zoom in ('min_zoom', 'max_zoom'):
if zoom in style:
params[zoom] = style[zoom]
Expand Down
6 changes: 6 additions & 0 deletions geoviews/tests/plotting/bokeh/test_tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from holoviews.tests.plotting.bokeh.test_plot import TestBokehPlot, bokeh_renderer

from geoviews.element import WMTS
from geoviews.plotting.bokeh import TilePlot
from geoviews.tile_sources import OSM


class TestWMTSPlot(TestBokehPlot):
Expand All @@ -17,3 +19,7 @@ def test_xyzservices_tileprovider(self):
assert glyph.attribution == osm.html_attribution
assert glyph.url == osm.build_url(scale_factor="@2x")
assert glyph.max_zoom == osm.max_zoom

def test_max_zoom_default(self):
tile_source = TilePlot(OSM).get_data(OSM, (0, 0, 0, 0), {})[1]["tile_source"]
assert tile_source.max_zoom == 19
4 changes: 2 additions & 2 deletions scripts/conda/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ else:
print('bokeh')
")

conda build scripts/conda/recipe-core --no-anaconda-upload --no-verify -c "$BK_CHANNEL"
conda build scripts/conda/recipe-recommended --no-anaconda-upload --no-verify -c "$BK_CHANNEL"
conda build scripts/conda/recipe-core --no-anaconda-upload --no-verify -c "$BK_CHANNEL" -c pyviz
conda build scripts/conda/recipe-recommended --no-anaconda-upload --no-verify -c "$BK_CHANNEL" -c pyviz

mv "$CONDA_PREFIX/conda-bld/noarch/$PACKAGE-core-$VERSION-py_0.tar.bz2" dist
mv "$CONDA_PREFIX/conda-bld/noarch/$PACKAGE-$VERSION-py_0.tar.bz2" dist

0 comments on commit 04c8c0a

Please sign in to comment.