[R-sig-Geo] Combine line segments into one line

Remon Hanna @khn@tonon||ne @end|ng |rom hotm@||@com
Fri Oct 8 14:55:26 CEST 2021


Hi

I have line segments that I would like to combine them within each corridor, I.e each corridor will be one line of combined segments of NAME_S2S and combined geometry  as per the screenshot.

I have managed to plot the segments on the map as you can see but when zooming in these segments are not in one, which I would like to group them.

I ran the below line to group them by corridor, but I get error below;

> dataformap1<-gLineMerge(dataformap[dataformap$Corridor==1, ])
Error in gLineMerge(dataformap[dataformap$Corridor == 1, ]) :
  Invalid geometry, may only be applied to lines

Many thanks in advance

Remon Hanna

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows



	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list