geoarrow / deck.gl-layers

deck.gl layers for rendering GeoArrow data
MIT License
73 stars 6 forks source link

PolygonLayer issues #102

Closed kylebarron closed 4 months ago

kylebarron commented 5 months ago

First, this validation fails: https://github.com/geoarrow/deck.gl-layers/blob/7932573c9dd899dc4c87a2b4b339ecfb01376cfa/src/polygon-layer.ts#L150-L153

The bigger issue: https://github.com/geoarrow/deck.gl-layers/blob/7932573c9dd899dc4c87a2b4b339ecfb01376cfa/src/validate.ts#L48-L53

When we explode the polygon -> LineString or MultiPolygon -> MultiLineString, we take the exterior in such a way as to expand the number of rows.

This will probably happen with any polygon data with holes, as that expands a single polygon into multiple linestrings.

I think the way to fix this is to fix exterior to not change the unit of observation. I'm not sure which should be the "general" exterior operation (as defined in geoarrow-js). E.g. GeoPandas/shapely don't define an "exterior" operation on multipolygons; rather it returns None for multi polygons.

image

So maybe this should be a local function in deck.gl-layers to "exterior without changing the number of table rows"