import cartopy.crs as ccrs import holoviews as hv import geoviews as gv import geoviews.feature as gf hv.extension('bokeh', 'matplotlib') %%opts Points [width=600 height=500] (size=6) nyc = (-74.0, 40.7, 'NYC') london = ( 0.1, 51.5, 'London') beijing = (116.4, 39.9, 'Beijing') points = gv.Points([nyc, london, beijing], vdims=['City'], extents=(-180, -90, 180, 90)) print('Default projection:', points.crs.__class__.__name__) points * gf.borders * gf.coastline %%opts Points [projection=ccrs.Robinson() width=800 height=400 global_extent=True] points * gf.borders * gf.coastline projected = gv.operation.project(points) print('New projection:', projected.crs.__class__.__name__) projected.dframe().set_index('City') import geoviews.tile_sources as gts gv.Layout([ts.relabel(name) for name, ts in gts.tile_sources.items()]).options( 'WMTS', xaxis=None, yaxis=None, width=225, height=225 ).cols(4) %%opts Feature [width=600 height=500 global_extent=True] import cartopy.feature as cf graticules = cf.NaturalEarthFeature( category='physical', name='graticules_30', scale='110m') gf.ocean * gf.land * gf.coastline * gv.Feature(graticules, group='Lines') import geopandas as gpd world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres')) world.head() %%opts Polygons [width=600 height=500 tools=['hover']] (cmap='viridis') gv.Polygons(world, vdims=['gdp_md_est', 'continent', 'name']).redim.range(Latitude=(-60, 90)) usa = world[world.name=='United States'].geometry.iloc[0] gv.Shape(usa)