inlabru-org / inlabru

inlabru
https://inlabru-org.github.io/inlabru/
78 stars 21 forks source link

update gg.SpatialPolygons to identify holes #95

Closed ASeatonSpatial closed 3 years ago

ASeatonSpatial commented 3 years ago

Currently a polygon with a hole is plotted like this when using the gg method

image

The disc is a hole but the plot treats it as it does the other polygons, it pays no attention to the hole logical variable that is included in the data.frame outputted by fortify.

Replacing geom_polygon with ggpolypath::geom_polypath in the gg.SpatialPolygons function produces a plot like this:

image

Seems like a simple enhancement so long as you are happy to take on the ggpolypath dependency. I briefly looked for solutions using geom_polygon but this seems like someone has already solved the problem.

finnlindgren commented 3 years ago

Sounds good! Can you make a PR adding the new package as a Suggests:, and does requireNamespace on it in gg.SpatialPolygons()?

ASeatonSpatial commented 3 years ago

Sure happy to do that!

finnlindgren commented 3 years ago

Fixed by fb9b0b8c068f1c8264f719dc8ddb74fd7c4208e7