This example illustrates how simply use the Geocoding Data Service
Note: You'll need CARTO Account credentials to reproduce this example.
In [13]:
from cartoframes.auth import set_default_credentials
set_default_credentials('creds.json')
In [14]:
import pandas
df = pandas.DataFrame([['Gran Vía 46', 'Madrid'], ['Ebro 1', 'Sevilla']], columns=['address','city'])
df
Out[14]:
In [15]:
from cartoframes.data.services import Geocoding
gc = Geocoding()
gdf, metadata = gc.geocode(df, street='address', city='city', country={'value': 'Spain'})
In [16]:
gdf
Out[16]:
In [17]:
metadata
Out[17]:
In [18]:
from cartoframes.viz import Layer
Layer(gdf)
Out[18]: