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.

  • names (list 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.

  • countries (list) – Parent countries. Should have same size as names. Can contain strings or Geocoder objects.

  • states (list) – Parent states. Should have same size as names. Can contain strings or Geocoder objects.

  • counties (list) – Parent counties. Should have same size as names. Can contain strings or Geocoder objects.

  • scope (str 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

Geocoder object specification.

Return type

NamesGeocoder

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).