Skip to content

[Deck.gl.Polygon] MultiplePolygon are not visible #32127

Closed

Description

@xavier-GitHub76

Bug description

Hello,

I build a dataset with polygons (GeoJSON) but multiple polygons are not visible on Deck.gl.Polygon chart.

I reduce the dataset, it has only 2 departements :

  • 'Deux-Sèvre' (build with a unique polygon)
  • 'Charente-Maritime' (build with a multipolygon)

The unique polygon is visible but
only one of multiples polygons is visible.

Image

Image

All polygons are visible with https://mapshaper.org
but not with Superset

Dataset is built with insert_DEPARTEMENT_(genereted).sql from DEPARTEMENT.json

insert_DEPARTEMENT_(genereted).zip

DEPARTEMENT.json

Image

Regards

Screenshots/recordings

No response

Superset version

4.0.2

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Activity

  1. dosubot commented on Feb 4, 2025

    @dosubot

    I found a similar unsolved discussion that might be relevant to your issue: Insert a Multipolygon into a Deck.gl Polygon chart, which was last updated on December 11, 2024 [1].

    For your specific issue with multipolygon visibility in Superset, here are a few steps you can take to troubleshoot:

    1. Check GeoJSON Format: Ensure that the GeoJSON for the multipolygon is correctly formatted. Each polygon in a multipolygon should be an array of linear rings, where the first ring is the outer boundary and any subsequent rings are holes.

    2. Superset Configuration: Verify the configuration options in Superset's Deck.gl Polygon layer. Make sure that the "Polygon Column" and "Polygon Encoding" settings are correctly set to handle multipolygon data [2].

    3. Simplification and Export: If you are using Mapshaper to simplify the polygons before importing them into Superset, ensure that the simplification process is not removing small features that are necessary for the multipolygon to render correctly.

    4. Logs and Errors: Check Superset's logs for any error messages that might indicate issues with rendering the multipolygon data.

    These steps should help you identify and resolve the visibility issue with your multipolygon data in Superset.

    To continue talking to Dosu, mention @dosu.


    Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

  2. paridbushati commented on Apr 22, 2025

    @paridbushati

    I have the same problem where only one polygon is visible and still haven't found a solution! @xavier-GitHub76 Have you found a solution in the meantime?

  3. xavier-GitHub76 commented on Apr 30, 2025

    @xavier-GitHub76
    ContributorAuthor

    For my part, I avoid the problem by playing with the precision of the map (with https://mapshaper.org) so that the smallest areas are erased.
    It's not a good solution

  4. rusackas commented on Sep 9, 2025

    @rusackas
    Member

    Maybe @DamianPendrak can take a look?

    Curious if this is indeed still happening on master but I would assume so.

  5. DamianPendrak commented on Sep 18, 2025

    @DamianPendrak
    Member

    @rusackas It looks like it got worse - no polygons appeared for me when I tried to replicate this on master. I will try to fix that along with the refactor of deck.gl charts from legacy API

  6. DamianPendrak commented on Sep 24, 2025

    @DamianPendrak
    Member

    @rusackas, I've checked again, and it looks like it no longer supports GeoJSON. The JSON polygon encoding expects an array of points for one polygon. Not sure if this is expected behavior, but it looks logical to me. If GeoJSON should be supported, it should probably be an additional option in the polygon encoding control.

    Image
  7. qleroy commented on Oct 17, 2025

    @qleroy
    Contributor

    @DamianPendrak
    The deck.gl Polygon layer works just fine for me on master.

  8. qleroy commented on Oct 17, 2025

    @qleroy
    Contributor

    @xavier-GitHub76
    I would love to make it work but it seems that The Polygon layer does NOT support Multipolygon or if it is it only takes the first one in the list.
    It expects only one Polygon https://deck.gl/docs/api-reference/layers/polygon-layer
    A MultiPolygon is truncated to the first Polygon right here

    polygonCoords = parsed.coordinates[0] || parsed.coordinates;

    relevant deck.gl issue visgl/deck.gl#7020

  9. qleroy commented on Oct 17, 2025

    @qleroy
    Contributor

    The GeoJson layer does display all Polygons but is not of much use for a choropleth map => cannot fill a polygon with a metric.

  10. rusackas commented on Jun 13, 2026

    @rusackas
    Member

    Thanks @qleroy, you're on the right trail here. The Polygon layer truncates a MultiPolygon to its first ring in transformProps.ts. @DamianPendrak, is this still on your radar for the deck.gl refactor? Seems like we'd either need to expand MultiPolygons into multiple polygons or offer a GeoJSON encoding option. Hopefully this isn't too painful of a PR in this AI era ;)

  11. muthubuntu commented on Jun 15, 2026

    @muthubuntu

    I have been using a method to use ST_Dump(multipolygon_geom) as taken from this post: https://stackoverflow.com/a/64783553

    Basically:

    SINGLEPART GEOM

    SELECT *, json_build_object(
      'type',       'Polygon',
      'geometry',   ST_AsGeoJSON(geom)::json)::text as geoJSON
    FROM <my-schema>.<my-table>;
    

    MULTIPART / MULTIPOLYGONS (will this also work for multilines and multipoints?)

    SELECT *, json_build_object(
      'type',       'Polygon',
      'geometry',   ST_AsGeoJSON((ST_DUMP(geom)).geom::geometry(Polygon, 27700))::json)::text as geoJSON
    FROM <my-schema>.<my-table>;
    
  12. DamianPendrak commented on Jun 20, 2026

    @DamianPendrak
    Member

    It was fixed in #40100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions