Download notebook (.ipynb)

Example of Geocoding With Rectangle Geometry: Japan#

from lets_plot.geo_data import *
from lets_plot import *
The geodata is provided by © OpenStreetMap contributors and is made available here under the Open Database License (ODbL).
LetsPlot.setup_html()
country = 'Japan'
bbox = geocode_countries(names=country)
gdf = geocode_states().scope(bbox).inc_res(4).get_boundaries()

ggplot() + \
    geom_rect(data=bbox.get_boundaries(), fill='lightslategray', size=0) + \
    geom_map(data=gdf, color='lightslategray', fill='white') + \
    ggsize(800, 600) + ggtitle(country) + \
    theme_void()