Skip to main content
WherobotsDB comes with SedonaPyDeck and SedonaKepler wrappers already installed, so you can create interactive maps from SedonaDataFrames right in your Jupyter environment.
Both SedonaPyDeck and SedonaKepler expect the default geometry order to be longitude-latitude. If your dataframe has geometries in the latitude-longitude order, consider using ST_FlipCoordinates to rearrange your coordinates.
Both SedonaPyDeck and SedonaKepler are designed to work with SedonaDataFrames containing only 1 geometry column. Passing dataframes with multiple geometry columns will cause errors.

SedonaPyDeck

Spatial query results can be visualized in a Jupyter lab/notebook environment using SedonaPydeck. SedonaPyDeck exposes APIs to create interactive map visualizations using pydeck based on deck.gl The following tutorial showcases the various maps that can be created using SedonaPyDeck, the datasets used to create these maps are publicly available. Each API exposed by SedonaPyDeck offers customization via optional arguments, details on all possible arguments can be found in the API docs of SedonaPyDeck.

Values from columns

The color, elevation, radius, and weight arguments of SedonaPyDeck take either a constant or a string expression over the columns of the DataFrame. For example, all of these are valid values of fill_color:
elevation_col, radius_col, and weight work the same way, with a number or an expression such as 'height * 2'. The maps use the carto provider and the dark style by default. Pass map_style, map_provider, and api_keys to change them; with map_style='satellite', SedonaPyDeck uses Mapbox unless map_provider is google_maps. See the pydeck documentation for these options.

Creating a Choropleth map using SedonaPyDeck

SedonaPyDeck exposes a create_choropleth_map API which can be used to visualize a choropleth map out of the passed SedonaDataFrame containing polygons with an observation: Example (referenced from example notebook available via binder):
plot_col is a required argument informing SedonaPyDeck of the column name used to render the choropleth effect.
The dataset used is available here and can also be found in the example notebook available here

Creating a Geometry map using SedonaPyDeck

SedonaPyDeck exposes a create_geometry_map API which can be used to visualize a passed SedonaDataFrame containing any type of geometries: Example (referenced from overture notebook available via binder):

Tip

elevation_col is an optional argument which can be used to render a 3D map. Pass the column with ‘elevation’ values for the geometries here.

Creating a scatter plot using SedonaPyDeck

SedonaPyDeck exposes a create_scatterplot_map API which can be used to visualize a scatter plot out of the passed SedonaDataFrame containing points: Example:
The dataset used here is the Chicago crimes dataset, available here

Creating a heatmap using SedonaPyDeck

SedonaPyDeck exposes a create_heatmap API which can be used to visualize a heatmap out of the passed SedonaDataFrame containing points: Example:
The dataset used here is the Chicago crimes dataset, available here

SedonaKepler

Spatial query results can be visualized in a Jupyter lab/notebook environment using SedonaKepler. SedonaKepler exposes APIs to create interactive and customizable map visualizations using KeplerGl. This tutorial showcases how simple it is to instantly visualize geospatial data using SedonaKepler. Example (referenced from an example notebook via the binder):
The dataset used is available here and can also be found in the example notebook available here

Names and saved configs

create_map and add_df take a name for each DataFrame they add, unnamed by default. A Kepler.gl map config refers to its layers and filters by these names, so a config applies only to a map whose DataFrames have the same names. Give each DataFrame a unique name. To show several DataFrames on one map, create the map and add each DataFrame to it:
The rendered map has a panel for customizing it. Its current config is available as map.config: save it, and pass it to create_map(config=...) to render the same map again, in this notebook or another one. See matching config with data in the Kepler.gl documentation. Details on all the APIs available by SedonaKepler are listed in the SedonaKepler API docs.