> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SedonaKepler

SedonaKepler offers a number of APIs which aid in quick and interactive visualization of a geospatial data in a Jupyter notebook/lab environment.

In order to start using SedonaKepler, simply import Sedona using:

```python theme={"system"}
from sedona.spark import *
```

Alternatively it can also be imported using:

```python theme={"system"}
from sedona.maps.SedonaKepler import SedonaKepler
```

Following are details on all the APIs exposed via SedonaKepler:

### **Creating a map object using SedonaKepler.create\_map**

SedonaKepler exposes a create\_map API with the following signature:

```python theme={"system"}
create_map(df: SedonaDataFrame=None, name: str='unnamed', config: dict=None) -> map
```

The parameter 'name' is used to associate the passed SedonaDataFrame in the map object and any config applied to the map is linked to this name. It is recommended you pass a unique identifier to the dataframe here.

If no SedonaDataFrame object is passed, an empty map (with config applied if passed) is returned. A SedonaDataFrame can be added later using the method `add_df`

A map config can be passed optionally to apply pre-apply customizations to the map.

<Note>
  The map config references every customization with the name assigned to the SedonaDataFrame being displayed, if there is a mismatch in the name, the config will not be applied to the map object.
</Note>

<Note>
  **Example usage (Referenced from Sedona Jupyter examples)**

  ```python theme={"system"}
  map = SedonaKepler.create_map(df=groupedresult, name="AirportCount")
  map
  ```
</Note>

### **Adding SedonaDataFrame to a map object using SedonaKepler.add\_df**

SedonaKepler exposes an add\_df API with the following signature:

```python theme={"system"}
add_df(map, df: SedonaDataFrame, name: str='unnamed')
```

This API can be used to add a SedonaDataFrame to an already created map object. The map object passed is directly mutated and nothing is returned.

The parameters name has the same conditions as 'create\_map'

<Tip>
  This method can be used to add multiple dataframes to a map object to be able to visualize them together.
</Tip>

<Note>
  **Example usage (Referenced from Sedona Jupyter examples)**

  ```python theme={"system"}
  map = SedonaKepler.create_map()
  SedonaKepler.add_df(map, groupedresult, name="AirportCount")
  map
  ```
</Note>

### **Setting a config via the map**

A map rendered by accessing the map object created by SedonaKepler includes a config panel which can be used to customize the map

### **Saving and setting config**

A map object's current config can be accessed by accessing its 'config' attribute like `map.config`. This config can be saved for future use or use across notebooks if the exact same map is to be rendered every time.

<Note>
  The map config references each applied customization with the name given to the dataframe and hence will work only on maps with the same name of dataframe supplied.
  For more details refer to keplerGl documentation [here](https://docs.kepler.gl/docs/keplergl-jupyter#6.-match-config-with-data)
</Note>
