lets_plot.geo_data.geocode

lets_plot.geo_data.geocode(level=None, names=None, countries=None, states=None, counties=None, scope=None) lets_plot.geo_data.geocoder.NamesGeocoder

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

Parameters
level{‘country’, ‘state’, ‘county’, ‘city’}

The level of administrative division. Autodetection by default.

nameslist or str

Names of objects to be geocoded. For ‘state’ level: ‘US-48’ returns continental part of United States (48 states) in a compact form.

countrieslist

Parent countries. Should have same size as names. Can contain strings or Geocoder objects.

stateslist

Parent states. Should have same size as names. Can contain strings or Geocoder objects.

countieslist

Parent counties. Should have same size as names. Can contain strings or Geocoder objects.

scopestr or Geocoder

Limits area of geocoding. If parent country is set then error will be generated. If type is a string - geoobject should have geocoded scope in parents. If type is a Geocoder - geoobject should have geocoded scope in parents. Scope should contain only one entry.

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('state').scope('Italy').get_boundaries(6)
6display(states.head())
7ggplot() + geom_map(data=states)
The geodata is provided by © OpenStreetMap contributors and is made available here under the Open Database License (ODbL).