From 967173555da75c300f776a737738f8b01fd492f8 Mon Sep 17 00:00:00 2001 From: Julia Haas <83269984+juleshaas@users.noreply.github.com> Date: Thu, 12 Oct 2023 09:21:31 +0200 Subject: [PATCH] change calculation of tree diameter (#63) --- .../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