Large area Geojson rendering issue

Hi there, I’m rendering a geojson polygon, the polygon/polygons are received from the backend. When rendering them using alternative mapping libraries (ol, leaflet) there are no issues but in cesium it is not rendered correctly ( as seen below )


the used geojson :

{
    type: "Feature",
    geometry: {
    type: "Polygon",
    coordinates: [
            [
                [
                    -125.10097222,
                    -88.48152778
                ],
                [
                    6.42569444,
                    -88.48152778
                ],
                [
                    6.42569444,
                    65.79263889
                ],
                [
                    -125.10097222,
                    65.79263889
                ],
                [
                    -125.10097222,
                    -88.48152778
                ]
            ]
        ]
    },

    properties: {},
}

the sandcastle below shows the geojson used and the result as well as the result

Hi there,

I believe you are running into a manifestation of this issue-- Large polygon rendering/fill issue · Issue #4871 · CesiumGS/cesium · GitHub. Basically, even in 2D mode, since the earth is an ellipsoid, large polygons will need to take the curvature of the earth into account.

The fix is fairly involved, as it requires triangulating the polygon to ensure all parts are above the ellipsoid. There are some workarounds described in that issue in the meantime.

1 Like

thanks a lot Gabby.