visgl / deck.gl

WebGL2 powered visualization framework
https://deck.gl
MIT License
12.24k stars 2.08k forks source link

[Bug] Deck.GL GeoJsonLayer incorrectly renders self intersecting polygons #8310

Open ivan-palatov opened 11 months ago

ivan-palatov commented 11 months ago

Description

The geojson layer incorrectly renders self intersecting polygons.

Currently those polygons look like this:

image

Flavors

Expected Behavior

image

Steps to Reproduce

StackBlitz

Environment

Logs

No response

GeorgeSkyPath commented 10 months ago

Are there any solutions just to filter such polygons for now?

ivan-palatov commented 9 months ago

Are there any solutions just to filter such polygons for now?

You could use unkinkPolygon from turf.js to make multiple polygons without kinks out of one with them.

It isn't ideal for me at least, since on a project I am working on there are tens of thoughsands of polygons and every bit of performance matters, so I just leave those be for now. Maybe I would write my own function for this instead with focus on performance.

Pessimistress commented 8 months ago

The GeoJsonLayer uses the earcut package to handle triangulation, which makes some trade offs between performance and correctness. You can find more details here.