Skip to main content

SedonaKepler

Plot Sedona DataFrames on Kepler.gl maps in a Jupyter notebook. Requires the keplergl package, installed with apache-sedona[kepler-map].

add_df()

Adds a SedonaDataFrame to a given map object. Raster columns are left out.

Parameters

required
Map object to add SedonaDataFrame to
required
SedonaDataFrame to add
default:"'unnamed'"
[Optional] Name to assign to the dataframe, default name assigned is ‘unnamed’

Returns

Does not return anything, adds df directly to the given map object

create_map()

Creates a map visualization using kepler, optionally taking a sedona dataFrame as data input

Parameters

default:"None"
[Optional] SedonaDataFrame to plot on the map
default:"'unnamed'"
[Optional] Name to be associated with the given dataframe, if a df is passed with no name, a default name of ‘unnamed’ is set for it.
default:"None"
[Optional] A Kepler.gl map config to be applied to the rendered map
default:"600"
[Optional] Height of the map in pixels, default is 600
default:"False"
[Optional] Whether to use Arrow to transfer the data to the map, default is False
default:"False"
[Optional] Whether to show the Kepler.gl documentation, default is False

Returns

A keplergl.KeplerGl map object

SedonaPyDeck

Import from sedona.spark.maps.SedonaPyDeck.
Plot Sedona DataFrames on pydeck maps in a Jupyter notebook. Requires the pydeck package, installed with apache-sedona[pydeck-map].

create_choropleth_map()

Create a pydeck map with a choropleth layer added

Parameters

required
SedonaDataFrame to plot on the choropleth map.
default:"None"
color scheme to fill the map with. If no color scheme is given, a default color scheme is created using the ‘plot_col’ column as the quantizing column
default:"None"
Column to be used to create a default color scheme. If fill_color is provided, this parameter is ignored.
default:"None"
Initial view state for the map
default:"None"
Map style to use
default:"None"
Map provider to use
default:"0"
Optional elevation for the polygons
default:"None"
Optional dictionary of API keys for Map providers
default:"True"
Whether to stroke the polygons

Returns

A pydeck Map object with choropleth layer added

create_geometry_map()

Create a pydeck map with a GeoJsonLayer added for plotting given geometries.

Parameters

required
SedonaDataFrame with polygons
default:"'[85, 183, 177, 255]'"
Optional color for the plotted polygons
default:"'[85, 183, 177, 255]'"
Optional color for the outlines of the plotted geometries
default:"0"
Optional column/numeric value to determine elevation for plotted polygons
default:"None"
optional initial view state of the pydeck map
default:"None"
optional map_style of the pydeck map
default:"None"
optional map_provider of the pydeck map
default:"None"
Optional dictionary of API keys for Map providers
default:"True"
Whether to draw the outlines of the polygons

Returns

A pydeck map with a GeoJsonLayer map added

create_heatmap()

Create a pydeck map with a heatmap layer added

Parameters

required
SedonaDataFrame to be used to plot the heatmap
default:"None"
Optional color_range for the heatmap
default:"1"
Optional column to determine weight of each point while plotting the heatmap
default:"'SUM'"
Optional aggregation to use for the heatmap (used when rendering a zoomed out heatmap)
default:"None"
Optional initial view state of the pydeck map
default:"None"
Optional map_style of the pydeck map
default:"None"
Optional map_provider for the pydeck map
default:"None"
Optional dictionary of API keys for Map providers

Returns

A pydeck map with a heatmap layer added

create_scatterplot_map()

Create a pydeck map with a scatterplot layer

Parameters

required
SedonaDataFrame to plot
default:"'[255, 140, 0]'"
color of the points
default:"1"
Column holding the radius of each point in meters, or a number to use as the radius of every point
default:"1"
Minimum radius of a point on screen, in pixels
default:"10"
Maximum radius of a point on screen, in pixels
default:"1"
Multiplier applied to every radius
default:"None"
optional initial view state of a pydeck map
default:"None"
optional map_style to be added to the pydeck map
default:"None"
optional map_provider to be added to the pydeck map
default:"None"
Optional dictionary of API keys for Map providers

Returns

A pydeck map object with a scatterplot layer added