[R-sig-Geo] Retrieve endpoints of MULTILINESTRINGS

PRIS, DEBORAH debor@h@pr|@@ @end|ng |rom durh@m@@c@uk
Mon Feb 28 16:40:26 CET 2022


"Linestrings.png": https://acrobat.adobe.com/link/track?uri=urn:aaid:scds:US:8407a39f-a9c6-409c-865e-ebd252316696
"Multilinstrings_grouped.png": https://acrobat.adobe.com/link/track?uri=urn:aaid:scds:US:9058d999-6bd0-4ba2-b308-941287711821
"Result_st_line_sample.png": https://acrobat.adobe.com/link/track?uri=urn:aaid:scds:US:e22f6121-5809-4bf4-88a9-9f39ab6334d2


Hello everyone, 

I have an sf object of multilinestrings (image "Linestrings") that I created by closing the gaps between (black) lines, thereby constructing a new set of (red) lines. I merged the two sets of lines into a multilinestring object and now would like to get the endpoints of every multilinestring. I know that there is the st_line_sample for linestrings, but when I st_cast my multilinestrings to linestrings, the function of course returns every endpoint from every linestring (black and red) that are contained in a mulitlinestring (image "Result_st_line_sample"). 

I grouped the individual linestrings to multilinestrings based on shared endpoints (image "Mulitlinestrings_grouped") but I don't know how to go on from there. I also tried to merge the mulitlinestrings into linestrings in various ways to overcome this issue and tested different approaches to get the endpoints, but nothing worked so far. 

Any help is much appreciated!

Many thanks,
Deborah



Deborah Priß (she/her/hers)
Early Stage Researcher / PhD student
Department of Geography
Durham University, UK

deborah.priss using durham.ac.uk
i-CONN network



More information about the R-sig-Geo mailing list