<p dir="ltr">Hello Leo,</p>
<p dir="ltr">That's quite straightforward actually. In the field calculator (or in any other instance of expression builder) there are 2 geometry functions to achieve what you need,  $x and $y.</p>
<p dir="ltr">You can either put them in separate fields or create a string to populate a single one. Something like this,</p>
<p dir="ltr">$x || ' , ' || $y</p>
<p dir="ltr">Would produce something like this:</p>
<p dir="ltr">'1234.56 , 9876.43'</p>
<p dir="ltr">Notice that the double pipe character || works as a string concatenator. And that the result is a string therefore not useful for any arithmetic operations after. </p>
<p dir="ltr">Hope this helped.</p>
<p dir="ltr">Best regards, </p>
<p dir="ltr">Alexandre Neto</p>
<div class="gmail_quote">Em 27/08/2014 22:37, "Leo Kris Palao" <<a href="mailto:lk.palao@gmail.com">lk.palao@gmail.com</a>> escreveu:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p>Hi QGIS users,</p>
<p>I don't know if this question has been asked before. </p>
<p>Can you help me create a syntax in field calculator to add in the attribute table the centroids coordinates for each or selected polygon features?</p>
<p>I am using Qgis 2.2 "Valmiera" version in Windows.</p>
<p>Thanks in advance for help,<br>
-Leo</p>
<br>_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br></blockquote></div>