-
Notifications
You must be signed in to change notification settings - Fork 11
Update Kepler.gl Version and Improvement #420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1141,16 +1141,20 @@ def execute(self, exec_context: knext.ExecutionContext, input_table): | |||||||||||||||||||
| after="", | ||||||||||||||||||||
| ) | ||||||||||||||||||||
| @knext.input_table( | ||||||||||||||||||||
| name="Geospatial Table to Visualize", | ||||||||||||||||||||
| description="Table with geospatial data to visualize", | ||||||||||||||||||||
| name="Geospatial Table", | ||||||||||||||||||||
| description="Primary table with geospatial data to visualize", | ||||||||||||||||||||
| ) | ||||||||||||||||||||
| @knext.input_table_group( | ||||||||||||||||||||
| name="Additional Geospatial Tables", | ||||||||||||||||||||
| description="Additional tables with geospatial data to visualize", | ||||||||||||||||||||
| ) | ||||||||||||||||||||
| @knext.output_view( | ||||||||||||||||||||
| name="Geospatial View", | ||||||||||||||||||||
| description="Showing a map with the geospatial data", | ||||||||||||||||||||
| static_resources="libs/kepler/2.5.5", | ||||||||||||||||||||
| ) | ||||||||||||||||||||
| class ViewNodeKepler: | ||||||||||||||||||||
| """Visualizes given geometric elements on a map. | ||||||||||||||||||||
| """Visualizes given geometric elements on a map with support for multiple datasets. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| This node will visualize the given geometric elements on a map using the [kepler.gl](https://kepler.gl/) | ||||||||||||||||||||
| visualization framework. This view is highly interactive and allows you to change various aspects of the view | ||||||||||||||||||||
|
|
@@ -1159,91 +1163,77 @@ class ViewNodeKepler: | |||||||||||||||||||
| creates an animation for a given time series column. For more information about the supported interactions | ||||||||||||||||||||
| see the [kepler.gl user guides](https://docs.kepler.gl/docs/user-guides). | ||||||||||||||||||||
|
|
||||||||||||||||||||
| This node requires at least one primary input table and supports additional tables through a dynamic input group. | ||||||||||||||||||||
| The primary table must contain a geometry column, while additional tables can contain geometry columns or | ||||||||||||||||||||
| other spatial data formats (like H3 indices, x/y coordinates, etc.) that can be configured within Kepler.gl. | ||||||||||||||||||||
| Each input table will be added as a separate layer in kepler.gl, making it easy to compare and analyze | ||||||||||||||||||||
| different geospatial datasets simultaneously. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| This node uses the [Mapbox GL JS API](https://www.mapbox.com/pricing#map-loads-for-web) which for commercial | ||||||||||||||||||||
| usage might require an [access token](https://docs.mapbox.com/help/glossary/access-token/). | ||||||||||||||||||||
| If you want to use a different base map, you can configure it inside the interactive | ||||||||||||||||||||
| view with Kepler.gl's UI. You can also configure the | ||||||||||||||||||||
| [Mapbox style](https://docs.kepler.gl/docs/user-guides/f-map-styles#custom-map-styles) you want to use and | ||||||||||||||||||||
| the access token. | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| By default, it takes all column information that is included inside the input table. | ||||||||||||||||||||
| By default, it takes all column information that is included inside the input tables. | ||||||||||||||||||||
| If you want to limit the amount of information sent to the node view you can use one of the | ||||||||||||||||||||
| [column filter](https://kni.me/n/DOkyMaii62U05xZ1) nodes to filter the input table. | ||||||||||||||||||||
| [column filter](https://kni.me/n/DOkyMaii62U05xZ1) nodes to filter the input tables. | ||||||||||||||||||||
| """ | ||||||||||||||||||||
|
|
||||||||||||||||||||
| geo_col = knext.ColumnParameter( | ||||||||||||||||||||
| "Geometry column", | ||||||||||||||||||||
| "Select the geometry column to visualize.", | ||||||||||||||||||||
| "Select the primary geometry column to visualize. ", | ||||||||||||||||||||
|
||||||||||||||||||||
| "Select the primary geometry column to visualize. ", | |
| "Select the primary geometry column to visualize.", |
Copilot
AI
Sep 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The geopandas import is duplicated - it's already imported in the helper methods _process_table and _process_additional_table. Consider moving all imports to the top of the method or removing the duplicate imports in the helper methods.
| import geopandas as gp |
Copilot
AI
Sep 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The _process_additional_table method uses self.attribute_cols which is configured based on the primary table schema, but it's being applied to additional tables that may have different schemas. This could cause issues if the additional tables don't have the same column structure as the primary table.
| # include only selected attribute columns that are not geospatial and the selected geospatial column | |
| attribute_columns = self.attribute_cols.apply(input_table.schema) | |
| included_column_names = list() | |
| for c in attribute_columns: | |
| if not knut.is_geo(c): | |
| included_column_names.append(c.name) | |
| # Dynamically include all non-geospatial columns and the geometry column from the current table | |
| included_column_names = [c.name for c in input_table.schema if not knut.is_geo(c)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the trailing space at the end of the comment line.