#!/usr/bin/env python # coding: utf-8 # In[1]: from lets_plot import * LetsPlot.setup_html() # In[2]: from lets_plot.geo_data import * # In[3]: # No level - autodetect, in case of ambiguity take state regions(request="New York") # In[ ]: # city regions(request='New York', level='city') # In[ ]: regions_builder(request='warwick', level='city').allow_ambiguous().build() # In[ ]: from shapely.geometry import box regions_builder(request='warwick', level='city') \ .where('warwick', within=box(-71.488034, 41.685644, -71.367528, 41.744844)) \ .build() # In[ ]: boston = regions(request='boston', within='usa') regions_builder(request='warwick', level='city') \ .where('warwick', near=boston) \ .build() # In[ ]: c = regions(level="country") # In[ ]: states = regions(request='us-48') # In[ ]: ggplot() + geom_point(map=states, color='black', size=10) # In[ ]: ggplot() + geom_polygon(aes(fill='request'), data=states, map=states, map_join=('request', 'request'))