lets_plot.geo_data.geocode_states

lets_plot.geo_data.geocode_states(names=None) lets_plot.geo_data.geocoder.NamesGeocoder

Create a NamesGeocoder object for states. Allow to refine ambiguous request with where() method, with a scope that limits area of geocoding or with parents.

Parameters
namesstr or list

Names of objects to be geocoded.

Returns
NamesGeocoder

Geocoder object specification.

Examples

1from IPython.display import display
2from lets_plot import *
3from lets_plot.geo_data import *
4LetsPlot.setup_html()
5states = geocode_states().scope('UK').get_boundaries()
6display(states)
7ggplot() + \
8    geom_map(aes(fill='found name'), data=states, color='white') + \
9    ggtitle('UK States')
The geodata is provided by © OpenStreetMap contributors and is made available here under the Open Database License (ODbL).
state found name geometry
0 Cymru / Wales Cymru / Wales MULTIPOLYGON (((-4.21875 51.61802, -4.21875 51...
1 Scotland Scotland MULTIPOLYGON (((-1.05469 60.28341, -1.14258 60...
2 England England MULTIPOLYGON (((-4.13086 50.34546, -4.21875 50...
3 Northern Ireland Northern Ireland MULTIPOLYGON (((-7.29492 54.16243, -7.29492 54...