I think your problem is that length() returns the length of a text-string, and not the length of a geometry. As the geometry isn't a string, the output is 0. As far as I can see it is not possible to do what you want with the default functions in the field calculator. With a bit of python in the function editor it should be possible.
Kristian -----Oprindelig meddelelse----- Fra: [email protected] [mailto:[email protected]] På vegne af Raymond Nijssen Sendt: søndag 05. juli 2015 19:49 Til: [email protected] Emne: [Qgis-user] get length of "custom" geometry in expression 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 [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-user _______________________________________________ Qgis-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-user
