Skip to content
Prev 29526 / 29559 Next

How to retrieve the interior boundary (points) of a polygon sf object

Dear Xiang,


thanks for your kind words.


1. The underlying assumption behind st_duplicated is that the polygons 
used to construct the multipolygon share some vertices in the interior 
part of the multipolygon. Your explanation and understandings are 
correct. If you want to check the implementation, see here: 
https://github.com/luukvdmeer/sfnetworks/blob/c6eb10a05768f570e94981e826de8ee3f7fb7fce/R/utils.R#L21


2. Yes, you are correct, you can simply use st_cast(..., "POINT"). I'm 
not sure whether one of the two approaches is much faster than the 
other, but I guess it doesn't matter here.


Kind regards

Andrea
On 8/8/2025 8:39 AM, Xiang Ye wrote: