<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://grasswiki.osgeo.org/w/index.php?action=history&amp;feed=atom&amp;title=HOWTO_get_centroid_coordinates</id>
	<title>HOWTO get centroid coordinates - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://grasswiki.osgeo.org/w/index.php?action=history&amp;feed=atom&amp;title=HOWTO_get_centroid_coordinates"/>
	<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=HOWTO_get_centroid_coordinates&amp;action=history"/>
	<updated>2026-04-11T18:22:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=HOWTO_get_centroid_coordinates&amp;diff=20537&amp;oldid=prev</id>
		<title>⚠️Madi: FAQ : how to get centroid coordinates</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=HOWTO_get_centroid_coordinates&amp;diff=20537&amp;oldid=prev"/>
		<updated>2014-06-18T13:59:03Z</updated>

		<summary type="html">&lt;p&gt;FAQ : how to get centroid coordinates&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
'''Q:''' I have a vector of polygons and I want to create a vector of points with the centroids of the polygons, with a connected table showing their coordinates. Which is the simplest way to do that?&lt;br /&gt;
&lt;br /&gt;
'''A:''' In Grass 6.4.x:&lt;br /&gt;
&lt;br /&gt;
 # Extract centroids from polygon map&lt;br /&gt;
 v.extract in=poly out=centr type=centroid&lt;br /&gt;
 # If needed convert centroids to points&lt;br /&gt;
 v.type in=centr out=centr_pts type=centroid,point&lt;br /&gt;
 # Add attribute table to points&lt;br /&gt;
 v.db.addtable centr_pts col=&amp;quot;x double,y double,z double&amp;quot;&lt;br /&gt;
 # Insert coords in table&lt;br /&gt;
 v.to.db TMP_centr_pts option=coor col=x,y,z&lt;br /&gt;
&lt;br /&gt;
In Grass 7:&lt;br /&gt;
&lt;br /&gt;
 v.out.ascii in=poly type=centroid&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:HowTo]]&lt;br /&gt;
[[Category:Vector]]&lt;/div&gt;</summary>
		<author><name>⚠️Madi</name></author>
	</entry>
</feed>