[Qgis-user] get length of "custom" geometry in expression

Richard McDonnell richard.mcdonnell at opw.ie
Mon Jul 6 02:49:17 PDT 2015


The easiest way to do this is to create a new column for the length 
variable
Just open the field calculator, leave the *create new field* box ticked, 
name your field in the *output field name* box
set your field width and precision and in the expression box just type 
/*$length*/
Regards,

Richard McDonnell

On 05/07/2015 18:49, Raymond Nijssen wrote:
> Im' trying to do this in my label expression:
>
> length($geometry)
>
> but it always returns 0. Is there a way I can do that? I tried 
> getlength() and getLength() as well, without luck.
>
> I know there is the $length which works on the geometry right away, 
> but i am performing a transformation first:
>
> length( transform($geometry, 'EPSG:3857', 'EPSG:3006') )
>
> Hoping anyone can help!
>
> Raymond
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>


OPW - Ag féachaint don am atá le teacht - Ag caomhnú ón am atá thart
OPW - Looking to the future - Caring for the past

***********************************************************
Email Disclaimer: http://www.opw.ie/en/disclaimer/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150706/06e8897b/attachment.html>


More information about the Qgis-user mailing list