non standard projections for gv.WMTS tiles
See original GitHub issueIs your feature request related to a problem? Please describe.
I’d like to be able to utilize WMTS tiles in a projection other Web Mercator (EPSG:3857), which currently does not seem possible. This is especially useful for Polar regions, where Polar Stereographic projections are commonly used. This functionality is available via ipyleaflet (https://github.com/jupyter-widgets/ipyleaflet/blob/master/examples/CustomProjections.ipynb), so I’m assuming the same should be possible with geoviews…
Describe the solution you’d like
I’d like to either be able to point to a pre-tiled non-EPSG:3857 WMTS such as https://wiki.earthdata.nasa.gov/display/GIBS/GIBS+API+for+Developers#GIBSAPIforDevelopers-Projections&Resolution , or have MapTiles reprojected on the fly.
import geoviews as gv
import geopandas as gpd
from shapely import geometry
import cartopy.crs as ccrs
import hvplot.pandas
S,N,W,E = [74.5, 80, -102, -98]
bbox = geometry.box(W,S,E,N)
gf = gpd.GeoDataFrame(geometry=[bbox], crs=4326)
crs = ccrs.NorthPolarStereo(central_longitude=-45, true_scale_latitude=70)
print(crs.proj4_init)
print(gf.crs)
# Tiles in EPSG3413 ?
tiles = gv.WMTS('https://gibs.earthdata.nasa.gov/wmts/epsg3413/best/BlueMarble_NextGeneration/default/EPSG3413_500m/{Z}/{Y}/{X}.jpeg',
crs=crs)
box = gf.hvplot.polygons(line_color='m', fill_color='m', fill_alpha=0.1,
ylim=(70,90), xlim=(-180, 180),
coastline=True, projection=crs)
tiles * box
Describe alternatives you’ve considered
Using tiles=True
keyword also produces an incorrect map without any tracebacks or warnings, so perhaps this should also be considered a bug and an error or warning is needed. Or maybe reprojecting on the fly is possible and I’m just unable to figure out the right incantation of settings?
Additional context
related issues: https://github.com/holoviz/geoviews/issues/427, https://github.com/holoviz/geoviews/issues/357
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:9 (5 by maintainers)
Top GitHub Comments
One trick now that I’ve merged the
gv.get_tile_rgb
utility would be to have a dynamicmap which fetches the tiles server-side and then projects them:Ok, then that specific bit is not supported; instead if you want to delay reprojection, you’ll currently need the final plotting projection to be Web Mercator. Hopefully we can get to this issue sometime soon and remove that limitation!