Visualize geometry results
WherobotsDB comes with SedonaPyDeck
and SedonaKepler
wrappers already installed, so you can create interactive maps from SedonaDataFrames right in your Jupyter environment.
Note
Both SedonaPyDeck
and SedonaKepler
expect the default geometry order to be longitude-latitude. If your dataframe has geometries in the latitude-longitude order, consider usingST_FlipCoordinates
to rearrange your coordinates.
Note
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
.
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):
SedonaPyDeck.create_choropleth_map(df=groupedresult, plot_col='AirportCount')
Note
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):
SedonaPyDeck.create_geometry_map(df_building, elevation_col='height')
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:
SedonaPyDeck.create_scatterplot_map(df=crimes_df)
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:
SedonaPyDeck.create_heatmap(df=crimes_df)
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):
SedonaKepler.create_map(df=groupedresult, name="AirportCount")
The dataset used is available here and can also be found in the example notebook available here
Details on all the APIs available by SedonaKepler
are listed in the SedonaKepler
API docs