Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_polygon_layer incompatible with sf #222

Open
sdamerdji opened this issue Feb 5, 2024 · 1 comment
Open

add_polygon_layer incompatible with sf #222

sdamerdji opened this issue Feb 5, 2024 · 1 comment

Comments

@sdamerdji
Copy link

Documentation claims:

An object of class sf is a data.frame with a geometry list-column. Set the layer prop that fetches the geometry to the geometry list-column of your sf object:

> # Example: PolygonLayer
> 
> props <- list(
>   getPolygon = ~geometry
>   # ...
> )

This R script shows this is not the case.

library(sf)
library(deckgl)


nc <- st_read(system.file("shape/nc.shp", package="sf"))

deck <- deckgl() %>%
  add_polygon_layer(
    data = nc,
    properties = list(getPolygon = ~geometry)
    ) %>%
  add_basemap()


if (interactive()) deck

When opened and inspected in the browser, there is the following error "deck: error during initialization of PolygonLayer({id: 'polygon-layer'}) Error: invalid polygon"

@sdamerdji
Copy link
Author

I see now a workaround was posted here #178 (comment)

Please kindly fix the documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant