Skip to content

mixed geometries #25

@ghost

Description

I think the solution here is, whenever a 'NA' / empty ID is found, it sends it down to the next level geometry. So multipolygon goes to polygon, polygon goes to linestring etc.

df <- data.frame(
  poly_id = c(1,1,1,1,NA,NA,NA,2,2,2)
  , line_id = rep(1,10)
  , x = 1:10
  , y = 1:10
)

And you'd call to_sf() on this, rather than the specific sf_polygon() calls.

  • GEOMETRY sfc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions