<html style="direction: ltr;">
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <style>body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
  </head>
  <body style="direction: ltr;"
    bidimailui-detected-decoding-type="latin-charset" bgcolor="#FFFFFF"
    text="#000000">
    On 06/03/2012 02:28 PM, ambrish dhaka wrote:
    <blockquote cite="mid:BLU119-W28C2F8DD03FCCA469D1DAFB70E0@phx.gbl"
      type="cite">
      <style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
      <div dir="ltr">
        Hi! all,<br>
        just a random exercise!<br>
        <br>
        if I have a set of lines then can they be connected through
        their endpoints to the nearest end-point of nearest line, thus
        creating a single line.<br>
        <br>
      </div>
    </blockquote>
    <br>
    You might be able to use the combination: <br>
    v.edit tool=snap thresh=-1,xxx   # where xxx is some relevant
    threshold value<br>
    and then<br>
    v.build.polylines<br>
    <br>
    <blockquote cite="mid:BLU119-W28C2F8DD03FCCA469D1DAFB70E0@phx.gbl"
      type="cite">
      <div dir="ltr">or<br>
        <br>
        Can we have a line generated through the centroids of the
        polygons in a single command.<br>
        <br>
      </div>
    </blockquote>
    <br>
    How about this:<br>
    First get the points from the centroids:<br>
    v.type in=polygons out=centroid_points type=centroid,point<br>
    Now run that point vector thru this pipe:<br>
    v.out.ascii centroid_points | v.in.lines in=- out=centroid_lines<br>
    <br>
    (Note that the lines will be connected in whatever order the
    polygons appear. Might result in spaghetti...)<br>
    <br>
    <br>
    <blockquote cite="mid:BLU119-W28C2F8DD03FCCA469D1DAFB70E0@phx.gbl"
      type="cite">
      <div dir="ltr">thanks!<br>
        Ambrish<br>
      </div>
      <br>
      <br>
      This mail was received via Mail-SeCure System.<br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
grass-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a>

This mail was received via Mail-SeCure System.


</pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>