New York Boroughs#

Download this notebook from GitHub (right-click to download).

import geodatasets as gds
import geopandas as gpd
import geoviews as gv
import as ccrs


Define data#

tiles = gv.tile_sources.OSM

# Project data to Web Mercator
nybb = gpd.read_file(gds.get_path('nybb'))
poly_data = nybb.to_crs(ccrs.GOOGLE_MERCATOR.proj4_init)
polys = gv.Polygons(poly_data, vdims=['BoroName'], crs=ccrs.GOOGLE_MERCATOR)


tiles * polys.opts(color='BoroName', cmap='Category20', width=800, height=600, tools=['hover', 'tap'])