Skip to content

Change CURVE-like sf types to "line" #3682

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

Conversation

yutannihilation
Copy link
Member

Fix #3651.

I'm still not sure how these geometries should be handled (or even whether there's a case ggplot2 should handle these or not), but at least COMPOUNDCURVE is converted to lines by sf::st_as_grob(). So, it seems ggplot2 should follow the way.

curve <- st_as_sfc("COMPOUNDCURVE(LINESTRING(0 0, 5 5))")
g <- sf::st_as_grob(curve)
g
#> (gTree[GRID.gTree.2])
is(g[[1]]$children[[1]])
#> [1] "lines"

Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thomasp85 thomasp85 added this to the ggplot2 3.3.0 milestone Jan 3, 2020
@yutannihilation yutannihilation merged commit 56294a7 into tidyverse:master Jan 3, 2020
@yutannihilation yutannihilation deleted the fix/issue-3651-curve-sf-type branch January 3, 2020 23:52
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

Successfully merging this pull request may close these issues.

sf_types categorizes CURVE-alike geometry incorrectly?
2 participants