Re: [R-sig-Geo] Sf find number of parts in multigeometry

2018-10-25 Thread Martin Tomko
Dear all, Thank you for the hints – I will test and report any surprises ☺ Martin From: Michael Sumner Date: Tuesday, 23 October 2018 at 5:59 pm To: Martin Tomko Cc: "r-sig-geo@r-project.org" Subject: Re: [R-sig-Geo] Sf find number of parts in multigeometry I see perfectly go

Re: [R-sig-Geo] Sf find number of parts in multigeometry

2018-10-23 Thread Michael Sumner
I see perfectly good answers to this, but can't resist sharing my own approach. I use gibble::gibble for a summary of parts. See how the multi-part object is number 4, and has 3 subobjects (subobject will repeat within object for holes). library(sf) x <- read_sf(system.file("gpkg/nc.gpkg",

Re: [R-sig-Geo] Sf find number of parts in multigeometry

2018-10-22 Thread Tim Appelhans
As an addition to obrl soil's answer, I have come to like lengths(st_geometry(x)) - mind the s! Best Tim On 10/23/2018 06:39 AM, obrl soil wrote: Hi Martin, for a multipolygon geometry column, you're working with a list of lists of lists of matrices, so you can iterate over the geometry