New york boroughs

In [1]:
import geopandas as gpd
import geoviews as gv
import cartopy.crs as ccrs

gv.extension('matplotlib')
%output fig='svg' dpi=120

Define data

In [2]:
tiles = gv.tile_sources.Wikipedia 

# Project data to Web Mercator
nybb = gpd.read_file(gpd.datasets.get_path('nybb'))
poly_data = nybb.to_crs(ccrs.GOOGLE_MERCATOR.proj4_init)
polys = gv.Polygons(poly_data, vdims='BoroName', crs=ccrs.GOOGLE_MERCATOR)
INFO:Fiona:Failed to auto identify EPSG: 7

Plot

In [3]:
%%opts Polygons [fig_size=200 color_index='BoroName'] (cmap='tab20') WMTS [zoom=10]
tiles * polys
Out[3]: