<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Dear<br>
<br>
I think it is not possible because you can have one attribute for
more than one geometry...<br>
<br>
Best regards<br>
<div class="moz-signature">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<title></title>
<font face="Arial" size="2,5"><b>
Frédéric Pons
</b></font><br>
<div class="moz-signature">
<div class="moz-signature"> <font color="#666666"
face="Arial" size="1"><b>
Expert hydraulique sur les inondations et aléas côtiers
<br>
</b></font><font color="#666666" face="Arial" size="1"><b>
DREC/Service Risques Inondations Littoraux et
Hydraulique
</b></font><font color="#666666" face="Arial" size="1"><b>
- Tél.: (33)4 42 24 76 68
</b></font><br>
<font color="#666666" face="Arial" size="1"><b>
Direction Territoriale Méditerranée<br>
</b></font>
<img alt="" src="cid:part1.06090506.02090807@cerema.fr"
height="45" width="183"><br>
<div class="moz-signature"><font color="#ee7f00"
face="Arial" size="1">Centre d’études et d’expertise sur
les risques, l’environnement, la mobilité et
l’aménagement
</font><br>
<a href="http://www.cerema.fr" class="moz-signature"><font
color="#ee7f00" face="Arial" size="4">www.cerema.fr</font></a><br>
<div class="moz-signature"> <font color="#666666"
face="Arial" size="1"> </font>
</div>
</div>
</div>
</div>
</div>
Le 04/12/2015 16:49, "> Bastien Tran (par Internet, dépôt
<a class="moz-txt-link-abbreviated" href="mailto:r-sig-geo-bounces@r-project.org">r-sig-geo-bounces@r-project.org</a>)" a écrit :<br>
</div>
<blockquote
cite="mid:CALktS8W4_DVozwG7izDDfLEn1FvF43ea5d1rFNDVDm2=UiUJdw@mail.gmail.com"
type="cite">
<pre wrap="">Dear all,
I am trying to extract the points that compose a SpatialLines object along
with the Line's ID (provided when Lines() is called).
Hoping it makes my question clearer this is what I am currently able to get
(using the SpatialLines example):
</pre>
<blockquote type="cite">
<pre wrap="">library(sp)
l1 = cbind(c(1,2,3),c(3,2,2))
Sl1 = Line(l1)
S1 = Lines(list(Sl1), ID=c("a"))
l2 = cbind(c(1,2,3),c(3,1.5,1))
Sl2 = Line(l2)
S2 = Lines(list(Sl2), ID="b")
L1 = SpatialLines(list(S1,S2))
sapply(slot(L1, "lines"), function(x) lapply(slot(x, "Lines"),
</pre>
</blockquote>
<pre wrap="">function(y) slot(y, "coords")))
[[1]]
[,1] [,2]
[1,] 1 3
[2,] 2 2
[3,] 3 2
[[2]]
[,1] [,2]
[1,] 1 3.0
[2,] 2 1.5
[3,] 3 1.0
But I would rather like to obtain something like this:
[[1]]
[,1] [,2] [,3]
[1,] "1" "3" "a"
[2,] "2" "2" "a"
[3,] "3" "2" "a"
[[2]]
[,1] [,2] [,3]
[1,] "1" "3" "b"
[2,] "2" "1.5" "b"
[3,] "3" "1" "b"
If possible I would like to avoid type conversions and get a data.frame
directly though I could indeed recreate one with these matrices, without
information loss I assume.
Thank you in advance for any tips.
Best regards,
Bastien
[[alternative HTML version deleted]]
_______________________________________________
R-sig-Geo mailing list
<a class="moz-txt-link-abbreviated" href="mailto:R-sig-Geo@r-project.org">R-sig-Geo@r-project.org</a>
<a class="moz-txt-link-freetext" href="https://stat.ethz.ch/mailman/listinfo/r-sig-geo">https://stat.ethz.ch/mailman/listinfo/r-sig-geo</a>
</pre>
</blockquote>
<br>
</body>
</html>