iGN5117 commented on code in PR #913: URL: https://github.com/apache/sedona/pull/913#discussion_r1272584274
########## docs/tutorial/sql.md: ########## @@ -509,26 +509,104 @@ There are lots of other functions can be combined with these queries. Please rea ==Sedona >= 1.5.0== +### SedonaPyDeck +Spatial query results can be visualized in Jupyter lab/notebook using SedonaPyDeck. + +SedonaPyDeck exposes APIs to create interactive map visualizations using [pydeck](https://pydeck.gl/index.html#) based on [deck.gl](https://deck.gl/) + + +#### 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: + +```python +def create_choropleth_map(cls, df, fill_color=None, plot_col=None, initial_view_state=None, map_style=None, map_provider=None): +``` + +The parameter `fill_color` can be given a list of RGB/RGBA values, or a string that contains RGB/RGBA values based on a column. + +For example, all these are valid values of fill_color: +```python +fill_color=[255, 12, 250] +fill_color=[0, 12, 250, 255] +fill_color='[0, 12, 240, AirportCount * 10]' ## AirportCount is a column in the passed df +``` + +Instead of giving a `fill_color` parameter, a 'plot_col' can be passed which specifies the column to decide the choropleth. +SedonaPyDeck then creates a default color scheme based on the values of the column passed + +Optionally, parameters `initial_view_state`, `map_style`, `map_provider` can be passed to configure the map as per user's liking. +More details on the parameters and their default values can be found on the pydeck website. + +#### Creating a Polygon map using SedonaPyDeck Review Comment: Yes, create_geometry_map() has been tested on polygon, point, linestring, multiLineString, multiPolygon and geometryCollection. I missed updating its heading in the doc, fixed it. Regarding scatterplot and createGeometryMap, scatter plot is specialized for point datasets and allows for more customization with respect to radius of the points plotted. I realize that scatterPlot API needs more customization options, I will refactor the API and its corresponding doc -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
