dosubot[bot] commented on issue #33618: URL: https://github.com/apache/superset/issues/33618#issuecomment-2919758760
<!-- Greeting --> Hi @IDunnThat! I'm [Dosu](https://go.dosu.dev/dosubot) and Iām helping the superset team. <!-- Answer --> Your suspicion is correct: the deck.gl GeoJSON chart in Apache Superset expects each geometry to be wrapped as a GeoJSON Feature, or ideally, as part of a FeatureCollection. The code and sample payloads in the Superset repository show that the expected structure is either a single Feature (with `type: "Feature"`, a `geometry` object, and optional `properties`) or a FeatureCollection (with `type: "FeatureCollection"` and a `features` array of Feature objects) [[example payload]](https://github.com/apache/superset/blob/master/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Polygon/geojsonPayload.js) [[Geojson.tsx processing]](https://github.com/apache/superset/blob/master/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/Geojson.tsx). If your `geometry_json` column contains only raw Polygon objects (e.g., `{ "type": "Polygon", ... }`), Superset will not recognize them as valid features for rendering. You should preprocess your data so that each row's geometry is wrapped like this: ```json { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [...] }, "properties": {} } ``` Or, if you are combining multiple geometries, use a FeatureCollection: ```json { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { ... }, "properties": {} }, ... ] } ``` Best practices for pre-processing: ensure every geometry is a valid GeoJSON Feature, and if possible, validate your GeoJSON using a tool or library before uploading. If your data comes from shapefiles or other GIS sources, use tools like `ogr2ogr` or Python's `geopandas` to export as GeoJSON Features. There are no existing issues or discussions in the Superset repository that address this specific problem with raw geometry objects not rendering. The inconsistent behavior when toggling "Ignore null locations" is likely a side effect of the chart's strict validation for the expected GeoJSON structure. Wrapping your geometries as Features should resolve the "0 rows" issue and allow deck.gl to render your polygons as expected. <!-- Dosu Comment Footer --> *To reply, just mention my name [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/11d0e50b-ff28-474e-a152-41e3fef225f8?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/11d0e50b-ff28-474e-a152-41e3fef225f8?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/11d0e50b-ff28-474e-a152-41e3fef225f8?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/11d0e50b-ff28-474e-a152-41e3fef225f8?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/11d0e50b-ff28-474e-a152-41e3fef225f8?feedback_type=hallucination) | [Report š](https://app.dosu.dev/response-feedback/11d0e50b-ff28-474e-a152-41e3fef225f8?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/11d0e50b-ff28-474e-a152-41e3fef225f8?feedback_type=other)</sup> [](https://go.dosu.dev/discord-bot) [! [Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/33618) -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
