From b1934fc2dad50e54d7dac4740058924632d554af Mon Sep 17 00:00:00 2001 From: Julia Haas Date: Wed, 11 Oct 2023 16:49:38 +0200 Subject: [PATCH] change calculation of tree diameter --- .../v.trees.param.worker/v.trees.param.worker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grass-gis-addons/m.analyse.trees/v.trees.param.worker/v.trees.param.worker.py b/grass-gis-addons/m.analyse.trees/v.trees.param.worker/v.trees.param.worker.py index 8a66035..f06f58b 100644 --- a/grass-gis-addons/m.analyse.trees/v.trees.param.worker/v.trees.param.worker.py +++ b/grass-gis-addons/m.analyse.trees/v.trees.param.worker/v.trees.param.worker.py @@ -215,7 +215,7 @@ def crowndiameter(list_attr, treecrowns): grass.run_command( "v.to.db", map=treecrowns, - option="perimeter", + option="area", columns=col_diameter, quiet=True, ) @@ -224,7 +224,7 @@ def crowndiameter(list_attr, treecrowns): "v.db.update", map=treecrowns, column=col_diameter, - query_column=f"{col_diameter}/{math.pi}", + query_column=f"2*(sqrt({col_diameter}/{math.pi}))", ) grass.message(_("Crown diameter was calculated.")) return col_diameter