<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=FR link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span lang=EN-US>Dear all&nbsp;,<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>I have a problem in converting some interpolated
contourLines into SLDF, using the function ContourLines2SLDF. I tried with the
example given in &#8220;Applied Spatial Data Analysis wit R&#8221;, but for
similar input data, the function returns a strange SLDF with my data&#8230; I
am then unable to check for equality between first and last coordinates (suitable
to create polygons)..<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Does someone know what&#8217;s wrong with
my code??<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Many thanks for your help!<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>library(maptools)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>load(&#8220;XXX/interpolated_den.Rdata&#8221;)&nbsp;
## the data is called DDD&#8230;<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>AA&lt;-contourLines(DDD,levels=c(2))&nbsp;&nbsp;&nbsp;
## I keep only the isolines of level 2<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>test&lt;-ContourLines2SLDF(AA)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
## library(maptools)&nbsp;&nbsp; transforme les isolignes en
SpatialLinesDataFrame<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>lns&lt;-slot(test,&quot;lines&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# as in the ASDAR p. 48<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>table(sapply(lns,function(x)
length(slot(x,&quot;Lines&quot;))))<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><i><span lang=EN-US style='color:#365F91'>## return 28/1
rather that 1/28 -&gt; lns is a list 1 object composed of 28 lines, rather than
being a list of 28 object of 1 lines&#8230;.<o:p></o:p></span></i></p>

<p class=MsoNormal><i><span lang=EN-US style='color:#365F91'>## thus I can&#8217;t
do the next step&#8230;<o:p></o:p></span></i></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>table(sapply(lignes, function(x) { <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>coord&lt;-slot(slot(x,&quot;Lines&quot;)[[1]],&quot;coords&quot;)
<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>identical(coord[1,],coord[nrow(coord),])}))<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;color:#336600'>___________________________________________________________<o:p></o:p></span></b></p>

<p class=MsoNormal><b><span lang=EN-US style='font-size:12.0pt;color:#336600'><o:p>&nbsp;</o:p></span></b></p>

<p class=MsoNormal><b><span lang=EN-US style='color:#336600'>Ervan Rutishauser<o:p></o:p></span></b></p>

<p class=MsoNormal><span lang=EN-US style='color:#336600'>PhD student<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='color:#336600'>CIRAD - UMR AMAP <br>
BP 701<br>
97387 Kourou Cedex </span><span lang=EN-US style='color:#1F497D'><o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#336600'>tel. 00594.594.32.92.96<o:p></o:p></span></p>

<p class=MsoNormal><span lang=FR-CH><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>