sedona.spark.maps package
Submodules
sedona.spark.maps.SedonaKepler module
- class sedona.spark.maps.SedonaKepler.SedonaKepler[source]
Bases:
object
- classmethod add_df(kepler_map, df, name='unnamed')[source]
Adds a SedonaDataFrame to a given map object. :param kepler_map: Map object to add SedonaDataFrame to :param df: SedonaDataFrame to add :param name: [Optional] Name to assign to the dataframe, default name assigned is ‘unnamed’ :return: Does not return anything, adds df directly to the given map object
- classmethod create_map(df=None, name='unnamed', config=None, height=600, use_arrow=False, show_docs=False)[source]
Creates a map visualization using kepler, optionally taking a sedona dataFrame as data input :param df: [Optional] SedonaDataFrame to plot on the map :param name: [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. param config: [Optional] A map config to be applied to the rendered map param height: [Optional] Height of the map in pixels, default is 600 param use_arrow: [Optional] Whether to use arrow for data transfer, default is False param show_docs: [Optional] Whether to show the documentation, default is False :return: A map object
sedona.spark.maps.SedonaMapUtils module
sedona.spark.maps.SedonaPyDeck module
- class sedona.spark.maps.SedonaPyDeck.SedonaPyDeck[source]
Bases:
object
- classmethod create_choropleth_map(df, fill_color=None, plot_col=None, initial_view_state=None, map_style=None, map_provider=None, elevation_col=0, api_keys=None, stroked=True)[source]
Create a pydeck map with a choropleth layer added
- Parameters:
df – SedonaDataFrame to plot on the choropleth map.
fill_color – 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
plot_col – Column to be used to create a default color scheme. If fill_color is provided, this parameter is ignored.
initial_view_state – Initial view state for the map
map_style – Map style to use
map_provider – Map provider to use
elevation_col – Optional elevation for the polygons
api_keys – Optional dictionary of API keys for Map providers
stroked – Whether to stroke the polygons
- Returns:
A pydeck Map object with choropleth layer added
- classmethod create_geometry_map(df, fill_color='[85, 183, 177, 255]', line_color='[85, 183, 177, 255]', elevation_col=0, initial_view_state=None, map_style=None, map_provider=None, api_keys=None, stroked=True)[source]
Create a pydeck map with a GeoJsonLayer added for plotting given geometries. :param line_color: :param df: SedonaDataFrame with polygons :param fill_color: Optional color for the plotted polygons :param elevation_col: Optional column/numeric value to determine elevation for plotted polygons :param initial_view_state: optional initial view state of the pydeck map :param map_style: optional map_style of the pydeck map :param map_provider: optional map_provider of the pydeck map :param api_keys: Optional dictionary of API keys for Map providers :return: A pydeck map with a GeoJsonLayer map added
- classmethod create_heatmap(df, color_range=None, weight=1, aggregation='SUM', initial_view_state=None, map_style=None, map_provider=None, api_keys=None)[source]
Create a pydeck map with a heatmap layer added :param df: SedonaDataFrame to be used to plot the heatmap :param color_range: Optional color_range for the heatmap :param weight: Optional column to determine weight of each point while plotting the heatmap :param aggregation: Optional aggregation to use for the heatmap (used when rendering a zoomed out heatmap) :param initial_view_state: Optional initial view state of the pydeck map :param map_style: Optional map_style of the pydeck map :param map_provider: Optional map_provider for the pydeck map :param api_keys: Optional dictionary of API keys for Map providers :return: A pydeck map with a heatmap layer added
- classmethod create_scatterplot_map(df, fill_color='[255, 140, 0]', radius_col=1, radius_min_pixels=1, radius_max_pixels=10, radius_scale=1, initial_view_state=None, map_style=None, map_provider=None, api_keys=None)[source]
Create a pydeck map with a scatterplot layer :param radius_scale: :param radius_max_pixels: :param radius_min_pixels: :param radius_col: :param df: SedonaDataFrame to plot :param fill_color: color of the points :param initial_view_state: optional initial view state of a pydeck map :param map_style: optional map_style to be added to the pydeck map :param map_provider: optional map_provider to be added to the pydeck map :param api_keys: Optional dictionary of API keys for Map providers :return: A pydeck map object with a scatterplot layer added