[R-sig-Geo] Create Nodes at lines' segments extremities.
Tristan Bourgeois
tristan.bourgeois at gmail.com
Thu Mar 2 17:53:11 CET 2017
Hi everybody,
I can't find any infomation about the gis manipulation I want to process on
R. Even if there are similar posts on r-sig-geo archives...
My issue is the following one :
>*myline<-readOGR(dsn = "./shapes/shp_tr_topo",layer =
"TRONCON_TOPO_Bresle" ) is a spatial polyline which is composed of :*
> *length(line at lines)*
[1] 585 => 585 segments
It seems that each of those 585 lines are acually a serie of points :
*> line at lines[[1]]@Lines*
[[1]]
An object of class "Line"
Slot "coords":
[,1] [,2]
[1,] 609046.7 6956543
[2,] 609057.3 6956543
[3,] 609077.6 6956546
[4,] 609103.2 6956553
[5,] 609132.5 6956561
[6,] 609146.0 6956568
[7,] 609157.4 6956574
[8,] 609167.0 6956577
[9,] 609176.9 6956581
[10,] 609184.4 6956585
[11,] 609191.9 6956588
[12,] 609199.3 6956591
[13,] 609205.7 6956594
[14,] 609212.6 6956599
[15,] 609216.6 6956604
[16,] 609222.6 6956609
[17,] 609229.0 6956613
[18,] 609237.9 6956619
[19,] 609244.4 6956623
[20,] 609253.5 6956626
[21,] 609265.2 6956631
[22,] 609276.5 6956636
[23,] 609287.4 6956639
[24,] 609296.9 6956644
[25,] 609305.1 6956647
[26,] 609308.6 6956653
What I want to obtain are the coordinates of each segments extremities. So
for a segment I should have 2 points with X,Y values.
I tried to apply the rgeos Gnode function but nothing appears as changed.
Maybe there's something to do with the min and max X,Y of each segments ?
Does somebody has already done /wrote a similar script to process that ??
Thank you in advance for the helpfull advices.
Cheers.
Tristan Bourgeois
Hydromorphologist Engineer
Seine Normandie Water Agency
Rouen, France
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list