Hi Alexander,<br><br><div class="gmail_quote">On Fri, Aug 24, 2012 at 11:42 AM, Alexander Muriy <span dir="ltr"><<a href="mailto:amuriy@gmail.com" target="_blank">amuriy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Margherita.<br><br><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have a vector of polygons and i want to create a vector of points with<br>
the centroids of the polygons, with a connected table showing their<br>
coordinates. Which is the simplest way to do that on G7?<br>
<br></blockquote></div><div><br>In GRASS 6.4.*:<br>-- extract centroids from polygon map<br>v.extract in=poly out=centr type=centroid<br>-- if needed convert centroids to points<br>v.type in=centr out=centr_pts type=centroid,point<br>
-- add attribute table to points<br>v.db.addtable centr_pts col="x double,y double,z double"<br>-- insert coords in table<br>v.to.db TMP_centr_pts option=coor col=x,y,z<br><br>I think in GRASS 7.0 it will be similar.<br>
</div></div></blockquote><div><br></div><div>Yes, indeed. I used:</div><div><br></div><div>v.extract in=poly out=centr type=centroid</div><div>v.type in=centr out=centr_pts from_type=centroid to_type=point</div><div>v.db.addcolumn map=centr_pts col="x double precision,y double precision"</div>
<div>v.to.db map=centr_pts option=coor col=x,y</div><div><br></div><div>Thanks!</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote">
<div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Dr. Margherita Di Leo<br>