[Qgis-user] Updating DBF with Field calculator

Philippe de FRANCLIEU pf at parcellesetpolygones.fr
Tue Jun 26 05:29:52 PDT 2012


Hello Leyan,

Thanks for the reply.

I'd like to report areas in hectares, perimeters and centroid cordinates in meters.
Length will probably default to the project Layer units, or the CRS.
Units for length might be feet, meters, yards, etc. to report the perimeter of a polygon.
Units for area might be acres, hectares, square meters, square feet, etc. but will default again to the project Layer units or the CRS

I'll have to create some fields and layers and make calculations as far as I understand it.

Philippe de FRANCLIEU

-----Message d'origine-----
De : 欧阳乐岩 [mailto:ouyang.leyan at hotmail.com] 
Envoyé : mardi 26 juin 2012 14:04
À : pf at parcellesetpolygones.fr
Objet : Re: [Qgis-user] Updating DBF with Field calculator



On 06/26/2012 06:16 PM, Philippe de FRANCLIEU wrote:
> Hi all,
> I 've created an Intersection layer with two shapefile layers (polygons).
> I now want to update the new database (DBF) and feed 4 new fields, say 
> IN_AREA, IN_PERIM, IN_X and IN_Y :
> 1) I wish I could specify the units. How could I?
> 2) The length button (Operators / 1.7.3) remains greyed-out though 
> $perimeter as Field calculator expression seems to work.
> 3) $x and $y return NULL's : how do I extract X's and Y's of centroïds 
> and feed IN_X and IN_Y?
> Using 1.7.3 and 1.8 on Windows 7x64.
> Thanks in advance for your help.
> Regards.
> Philippe de FRANCLIEU
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>

As far as I know, you cannot change the units. It is meter.

Concerning the operators, only perimeter and area make sense for a polygon layer. For coordinates of centroids, you can create said centroids as a point layer (using ftools, vector->Geometry 
tools->Polygon centroid), calculate their coordinates and link them back
to the polygon.

About the length, what do you want to calculate?

Leyan




More information about the Qgis-user mailing list