<span id="result_box" class="short_text" lang="en"><span class="hps"> This</span> <span class="hps">question was asked</span></span> in  <a href="http://gis.stackexchange.com/questions/28061/how-to-access-vector-coordinates-in-grass-gis-from-python/28100#28100">http://gis.stackexchange.com/questions/28061/how-to-access-vector-coordinates-in-grass-gis-from-python/28100#28100</a> and I propose a solution with <b>v.out.ascii.</b><br>

<br><span id="result_box" class="" lang="en"><span class="hps">But is</span> <span class="hps">there a better</span> <span class="hps">solution ?</span></span><br><br>My solution (a single line -> L 7 1)<br><br>    test = grass.read_command("v.out.ascii", input="linevector", format="standard")<br>

    result = test.split("\n") <br>    import re<br>    for line in result:<br>         if re.findall(r'^.[0-9]+\.',line):<br>                print line<br><br>     206643.21517601 125181.18058576<br>     201007.33432923 121517.8555206<br>

     208615.77587567 118699.91687157<br>     199034.77765775 115036.59058769<br>     200725.54321492 111936.8560102<br>     192835.30987687 107428.14794157<br>     192835.30987687 107428.14794157<br><br>and <br><br>    coords = []    <br>

    for line in result:<br>       if re.findall(r'^.[0-9]+\.',line): <br>           coords.append(line.strip().split(" "))<br><br>    [['206643.21517601', '125181.18058576'], ['201007.33432923', '121517.8555206'], ['208615.77587567', '118699.91687157'], ['199034.77765775', '115036.59058769'], ['200725.54321492', '111936.8560102'], ['192835.30987687', '107428.14794157'], ['192835.30987687', '107428.14794157'], ['206643.21517601', '125181.18058576'], ['201007.33432923', '121517.8555206'], ['208615.77587567', '118699.91687157'], ['199034.77765775', '115036.59058769'], ['200725.54321492', '111936.8560102'], ['192835.30987687', '107428.14794157'], ['192835.30987687', '107428.14794157']]<br>

<br>If you want, you can create a new point layer from the coordinates (solution of Yvan Marchesini in <a href="http://osgeo-org.1560.n6.nabble.com/How-one-can-find-the-starting-and-end-point-of-a-line-in-a-vector-file-or-how-one-can-connect-two-lie-td4542252.html">http://osgeo-org.1560.n6.nabble.com/How-one-can-find-the-starting-and-end-point-of-a-line-in-a-vector-file-or-how-one-can-connect-two-lie-td4542252.html</a>)<br>

<br><br>