From b23d0a4a8f7f8b87f6e621340420932533e44c82 Mon Sep 17 00:00:00 2001 From: Julia Haas Date: Tue, 2 Jan 2024 13:50:41 +0100 Subject: [PATCH 1/4] add and sort keywords --- .../r.extract.buildings.worker.py | 6 +++--- .../r.extract.buildings/r.extract.buildings.py | 6 +++--- .../r.extract.greenroofs.worker.py | 5 +++-- .../r.extract.greenroofs/r.extract.greenroofs.py | 7 ++++--- .../v.cd.areas.worker/v.cd.areas.worker.py | 5 +++-- .../m.analyse.buildings/v.cd.areas/v.cd.areas.py | 5 +++-- 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/grass-gis-addons/m.analyse.buildings/r.extract.buildings.worker/r.extract.buildings.worker.py b/grass-gis-addons/m.analyse.buildings/r.extract.buildings.worker/r.extract.buildings.worker.py index 1ed5646..ad2d23a 100644 --- a/grass-gis-addons/m.analyse.buildings/r.extract.buildings.worker/r.extract.buildings.worker.py +++ b/grass-gis-addons/m.analyse.buildings/r.extract.buildings.worker/r.extract.buildings.worker.py @@ -8,7 +8,7 @@ # # PURPOSE: Extracts buildings from nDSM, NDVI and FNK # -# COPYRIGHT: (C) 2023 by mundialis and the GRASS Development Team +# COPYRIGHT: (C) 2023 - 2024 by mundialis and the GRASS Development Team # # This program is free software under the GNU General Public # License (>=v2). Read the file COPYING that comes with GRASS @@ -19,9 +19,9 @@ # %Module # % description: Extracts buildings from nDSM, NDVI and FNK. # % keyword: raster -# % keyword: statistics -# % keyword: change detection # % keyword: classification +# % keyword: statistics +# % keyword: buildings analysis # %end # %option G_OPT_R_INPUT diff --git a/grass-gis-addons/m.analyse.buildings/r.extract.buildings/r.extract.buildings.py b/grass-gis-addons/m.analyse.buildings/r.extract.buildings/r.extract.buildings.py index e1375e2..e16a3f4 100644 --- a/grass-gis-addons/m.analyse.buildings/r.extract.buildings/r.extract.buildings.py +++ b/grass-gis-addons/m.analyse.buildings/r.extract.buildings/r.extract.buildings.py @@ -8,7 +8,7 @@ # # PURPOSE: Extracts buildings from nDSM, NDVI and FNK # -# COPYRIGHT: (C) 2021 - 2023 by mundialis and the GRASS Development Team +# COPYRIGHT: (C) 2021 - 2024 by mundialis and the GRASS Development Team # # This program is free software under the GNU General Public # License (>=v2). Read the file COPYING that comes with GRASS @@ -19,9 +19,9 @@ # %Module # % description: Extracts buildings from nDSM, NDVI and FNK. # % keyword: raster -# % keyword: statistics -# % keyword: change detection # % keyword: classification +# % keyword: statistics +# % keyword: buildings analysis # %end # %option G_OPT_R_INPUT diff --git a/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py b/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py index aff18f1..195d5dd 100644 --- a/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py +++ b/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py @@ -8,7 +8,7 @@ # # PURPOSE: Worker GRASS GIS addon to extract greenroofs # -# COPYRIGHT: (C) 2023 by mundialis and the GRASS Development Team +# COPYRIGHT: (C) 2023 - 2024 by mundialis and the GRASS Development Team # # This program is free software under the GNU General Public # License (>=v2). Read the file COPYING that comes with GRASS @@ -19,9 +19,10 @@ # %Module # % description: Worker GRASS GIS addon to extract greenroofs. # % keyword: raster +# % keyword: classification # % keyword: statistics +# % keyword: buildings analysis # % keyword: greenroofs -# % keyword: classification # %end # %option diff --git a/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs/r.extract.greenroofs.py b/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs/r.extract.greenroofs.py index 05a1396..6feff7c 100644 --- a/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs/r.extract.greenroofs.py +++ b/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs/r.extract.greenroofs.py @@ -9,7 +9,7 @@ # PURPOSE: Extracts green roofs on buildings from nDSM, NDVI, GB-Ratio, # FNK and building outlines # -# COPYRIGHT: (C) 2022-2023 by mundialis and the GRASS Development Team +# COPYRIGHT: (C) 2022 - 2024 by mundialis and the GRASS Development Team # # This program is free software under the GNU General Public # License (>=v2). Read the file COPYING that comes with GRASS @@ -20,9 +20,10 @@ # %Module # % description: Extracts green roofs from nDSM, NDVI, GB-Ratio, FNK and building outlines. # % keyword: raster -# % keyword: statistics -# % keyword: change detection # % keyword: classification +# % keyword: statistics +# % keyword: buildings analysis +# % keyword: greenroofs # %end # %option G_OPT_R_INPUT diff --git a/grass-gis-addons/m.analyse.buildings/v.cd.areas.worker/v.cd.areas.worker.py b/grass-gis-addons/m.analyse.buildings/v.cd.areas.worker/v.cd.areas.worker.py index 87b36ef..e61cc4c 100644 --- a/grass-gis-addons/m.analyse.buildings/v.cd.areas.worker/v.cd.areas.worker.py +++ b/grass-gis-addons/m.analyse.buildings/v.cd.areas.worker/v.cd.areas.worker.py @@ -9,7 +9,7 @@ # PURPOSE: Worker GRASS GIS addon to detect changes between two vector # layers # -# COPYRIGHT: (C) 2023 by mundialis and the GRASS Development Team +# COPYRIGHT: (C) 2023 - 2024 by mundialis and the GRASS Development Team # # This program is free software under the GNU General Public # License (>=v2). Read the file COPYING that comes with GRASS @@ -20,9 +20,10 @@ # %Module # % description: Calculates difference between two vector layers (e.g. buildings). # % keyword: vector +# % keyword: classification # % keyword: statistics +# % keyword: buildings analysis # % keyword: change detection -# % keyword: classification # %end # %option G_OPT_V_INPUT diff --git a/grass-gis-addons/m.analyse.buildings/v.cd.areas/v.cd.areas.py b/grass-gis-addons/m.analyse.buildings/v.cd.areas/v.cd.areas.py index a9f49b7..bdc20d6 100644 --- a/grass-gis-addons/m.analyse.buildings/v.cd.areas/v.cd.areas.py +++ b/grass-gis-addons/m.analyse.buildings/v.cd.areas/v.cd.areas.py @@ -9,7 +9,7 @@ # PURPOSE: Calculates difference between two vector layers (e.g. buildings) # and optionally calculates quality measures # -# COPYRIGHT: (C) 2021 - 2023 by mundialis and the GRASS Development Team +# COPYRIGHT: (C) 2021 - 2024 by mundialis and the GRASS Development Team # # This program is free software under the GNU General Public # License (>=v2). Read the file COPYING that comes with GRASS @@ -20,9 +20,10 @@ # %Module # % description: Calculates difference between two vector layers (e.g. buildings). # % keyword: vector +# % keyword: classification # % keyword: statistics +# % keyword: buildings analysis # % keyword: change detection -# % keyword: classification # %end # %option G_OPT_V_INPUT From 8e509a478e9885825c48fd077c8cf445d672d0df Mon Sep 17 00:00:00 2001 From: Julia Haas Date: Tue, 2 Jan 2024 16:19:00 +0100 Subject: [PATCH 2/4] reorder parameters, add guisection, cleanup --- .../r.extract.buildings.worker.html | 2 +- .../r.extract.buildings.worker.py | 52 +++++++---------- .../r.extract.buildings.html | 2 +- .../r.extract.buildings.py | 43 ++++++++------ .../r.extract.greenroofs.worker.py | 22 ++----- .../r.extract.greenroofs.html | 2 +- .../r.extract.greenroofs.py | 58 +++++++++++-------- .../v.cd.areas.worker/v.cd.areas.worker.py | 29 +++++----- .../v.cd.areas/v.cd.areas.py | 11 +++- 9 files changed, 114 insertions(+), 107 deletions(-) diff --git a/grass-gis-addons/m.analyse.buildings/r.extract.buildings.worker/r.extract.buildings.worker.html b/grass-gis-addons/m.analyse.buildings/r.extract.buildings.worker/r.extract.buildings.worker.html index 4761bc9..0df16bb 100644 --- a/grass-gis-addons/m.analyse.buildings/r.extract.buildings.worker/r.extract.buildings.worker.html +++ b/grass-gis-addons/m.analyse.buildings/r.extract.buildings.worker/r.extract.buildings.worker.html @@ -3,7 +3,7 @@

DESCRIPTION

r.extract.buildings.worker is a worker module that is started by r.extract.buildings. It extracts buildings as vectors using an nDSM-raster, NDVI-raster, and FNK-vector -(Flaechennutzungskatalog). +(Flaechennutzungskartierung).

SEE ALSO

diff --git a/grass-gis-addons/m.analyse.buildings/r.extract.buildings.worker/r.extract.buildings.worker.py b/grass-gis-addons/m.analyse.buildings/r.extract.buildings.worker/r.extract.buildings.worker.py index ad2d23a..9171d8c 100644 --- a/grass-gis-addons/m.analyse.buildings/r.extract.buildings.worker/r.extract.buildings.worker.py +++ b/grass-gis-addons/m.analyse.buildings/r.extract.buildings.worker/r.extract.buildings.worker.py @@ -21,14 +21,27 @@ # % keyword: raster # % keyword: classification # % keyword: statistics -# % keyword: buildings analysis +# % keyword: worker +# %end + +# %option G_OPT_V_INPUT +# % key: area +# % label: Input natural tiles as vector map +# %end + +# %option +# % key: new_mapset +# % type: string +# % required: yes +# % multiple: no +# % key_desc: name +# % label: Name for new mapset # %end # %option G_OPT_R_INPUT # % key: ndsm # % type: string # % required: yes -# % multiple: no # % label: Name of the nDSM # %end @@ -36,31 +49,27 @@ # % key: ndvi_raster # % type: string # % required: yes -# % multiple: no # % label: Name of the NDVI raster # %end -# %option G_OPT_V_INPUTS +# %option G_OPT_V_INPUT # % key: fnk_vector # % type: string # % required: no -# % multiple: no -# % label: Vector map containing Flaechennutzungskatalog +# % label: Vector map containing Flaechennutzungskartierung # %end -# %option G_OPT_R_INPUTS +# %option G_OPT_R_INPUT # % key: fnk_raster # % type: string # % required: no -# % multiple: no -# % label: Raster map containing Flaechennutzungskatalog +# % label: Raster map containing Flaechennutzungskartierung # %end -# %option G_OPT_R_INPUTS +# %option G_OPT_R_INPUT # % key: fnk_column # % type: string # % required: no -# % multiple: no # % label: Integer column containing FNK-code # %end @@ -90,36 +99,19 @@ # % label: NDVI threshold (user-defined or estimated from FNK, scale 0-255) # %end -# %option G_OPT_MEMORYMB -# %end - # %option G_OPT_R_OUTPUT # % key: output # % type: string # % required: yes -# % multiple: no # % label: Name for output vector map -# % guisection: Output -# %end - -# %option -# % key: new_mapset -# % type: string -# % required: yes -# % multiple: no -# % key_desc: name -# % description: Name for new mapset # %end -# %option G_OPT_V_INPUT -# % key: area -# % multiple: no -# % description: Input natural tiles as vector map +# %option G_OPT_MEMORYMB # %end # %flag # % key: s -# % description: Segment image based on nDSM and NDVI before building extraction +# % label: Segment image based on nDSM and NDVI before building extraction # %end # %rules diff --git a/grass-gis-addons/m.analyse.buildings/r.extract.buildings/r.extract.buildings.html b/grass-gis-addons/m.analyse.buildings/r.extract.buildings/r.extract.buildings.html index ee676bc..375a67a 100644 --- a/grass-gis-addons/m.analyse.buildings/r.extract.buildings/r.extract.buildings.html +++ b/grass-gis-addons/m.analyse.buildings/r.extract.buildings/r.extract.buildings.html @@ -3,7 +3,7 @@

DESCRIPTION

r.extract.buildings extracts buildings as vectors and calculates height statistics (minimum, maximum, average, standard deviation, median, percentile) and presumable number of stories using -an nDSM-raster, NDVI-raster, and FNK-vector (Flaechennutzungskatalog). +an nDSM-raster, NDVI-raster, and FNK-vector (Flaechennutzungskartierung). As certain area codes from the FNK are used, the class codes have to be consistent. The extraction can be based on an image segmentation using i.segment, which requires the -s diff --git a/grass-gis-addons/m.analyse.buildings/r.extract.buildings/r.extract.buildings.py b/grass-gis-addons/m.analyse.buildings/r.extract.buildings/r.extract.buildings.py index e16a3f4..6890e32 100644 --- a/grass-gis-addons/m.analyse.buildings/r.extract.buildings/r.extract.buildings.py +++ b/grass-gis-addons/m.analyse.buildings/r.extract.buildings/r.extract.buildings.py @@ -28,32 +28,34 @@ # % key: ndsm # % type: string # % required: yes -# % multiple: no -# % label: Name of the nDSM +# % label: Name of the nDSM raster +# % guisection: Input # %end # %option G_OPT_R_INPUT # % key: ndvi_raster # % type: string # % required: yes -# % multiple: no # % label: Name of the NDVI raster +# % guisection: Input # %end -# %option G_OPT_V_INPUTS +# %option G_OPT_V_INPUT # % key: fnk_vector # % type: string # % required: yes -# % multiple: no -# % label: Vector map containing Flaechennutzungskatalog +# % label: Vector map containing Flaechennutzungskartierung +# % guisection: Input +# % guidependency: fnk_column # %end -# %option G_OPT_V_INPUTS +# %option G_OPT_DB_COLUMN # % key: fnk_column # % type: string # % required: yes # % multiple: no # % label: Integer column containing FNK-code +# % guisection: Input # %end # %option @@ -63,6 +65,7 @@ # % multiple: no # % label: Minimum size of buildings in sqm # % answer: 20 +# % guisection: Parameters # %end # %option @@ -72,39 +75,43 @@ # % multiple: no # % label: Maximum value of fractal dimension of identified objects (see v.to.db) # % answer: 2.1 +# % guisection: Parameters # %end # %option -# % key: ndvi_perc +# % key: ndvi_thresh # % type: integer # % required: no # % multiple: no -# % label: ndvi percentile in vegetated areas to use for thresholding +# % label: Define fix NDVI threshold (on a scale from 0-255) instead of estimating it from FNK +# % guisection: Parameters # %end # %option -# % key: ndvi_thresh +# % key: ndvi_perc # % type: integer # % required: no # % multiple: no -# % label: Define fix NDVI threshold (on a scale from 0-255) instead of estimating it from FNK -# %end - -# %option G_OPT_MEMORYMB +# % label: NDVI percentile in vegetated areas to use for thresholding +# % guisection: Parameters # %end # %option G_OPT_V_OUTPUT # % key: output # % type: string # % required: yes -# % multiple: no # % label: Name for output vector map # % guisection: Output # %end +# %option G_OPT_MEMORYMB +# % guisection: Parallel processing +# %end + # %option G_OPT_M_NPROCS -# % description: Number of cores for multiprocessing, -2 is the number of available cores - 1 +# % label: Number of cores for multiprocessing, -2 is the number of available cores - 1 # % answer: -2 +# % guisection: Parallel processing # %end # %option @@ -114,11 +121,13 @@ # % multiple: no # % label: Define edge length of grid tiles for parallel processing # % answer: 1000 +# % guisection: Parallel processing # %end # %flag # % key: s -# % description: Segment image based on nDSM and NDVI before building extraction +# % label: Segment image based on nDSM and NDVI before building extraction +# % guisection: Parameters # %end # %rules diff --git a/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py b/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py index 195d5dd..65760ce 100644 --- a/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py +++ b/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py @@ -21,8 +21,7 @@ # % keyword: raster # % keyword: classification # % keyword: statistics -# % keyword: buildings analysis -# % keyword: greenroofs +# % keyword: worker # %end # %option @@ -37,7 +36,6 @@ # % key: area # % type: string # % required: yes -# % multiple: no # % label: Vector map containing area # %end @@ -45,7 +43,6 @@ # % key: building_outlines # % type: string # % required: yes -# % multiple: no # % label: Vector map containing outlines of buildings # %end @@ -53,18 +50,13 @@ # % key: buildings # % type: string # % required: yes -# % multiple: no # % label: Raster map containing buildings # %end -# %option G_OPT_MEMORYMB -# %end - # %option G_OPT_R_INPUT # % key: ndsm # % type: string # % required: yes -# % multiple: no # % label: Name of the nDSM raster # %end @@ -72,7 +64,6 @@ # % key: gb_ratio # % type: string # % required: yes -# % multiple: no # % label: Name of the GB-ratio raster # %end @@ -80,7 +71,6 @@ # % key: rg_ratio # % type: string # % required: yes -# % multiple: no # % label: Name of the RG-ratio raster # %end @@ -88,7 +78,6 @@ # % key: brightness # % type: string # % required: yes -# % multiple: no # % label: Name of the brightness raster # %end @@ -96,7 +85,6 @@ # % key: ndvi # % type: string # % required: yes -# % multiple: no # % label: Name of the NDVI raster # %end @@ -153,18 +141,20 @@ # %option G_OPT_V_OUTPUT # % key: output_vegetation # % required: yes -# % multiple: no # % label: Name of output roof vegetation vector map # %end +# %option G_OPT_MEMORYMB +# %end + # %flag # % key: s -# % description: Segment image based on nDSM, NDVI and blue/green ratio before green roof extraction +# % label: Segment image based on nDSM, NDVI and blue/green ratio before green roof extraction # %end # %flag # % key: t -# % description: Trees are used for the selection +# % label: Use trees for the selection # %end # %rules diff --git a/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs/r.extract.greenroofs.html b/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs/r.extract.greenroofs.html index 8b375c2..cb2819c 100644 --- a/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs/r.extract.greenroofs.html +++ b/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs/r.extract.greenroofs.html @@ -2,7 +2,7 @@

DESCRIPTION

r.extract.greenroofs extracts vegetated roofs from aerial photographs, an nDSM, a building vector layer and optionally an FNK -(Flaechennutzungskatalog) and tree vector layer. The module generates +(Flaechennutzungskartierung) and tree vector layer. The module generates two outputs: The buildings outlines that have vegetated roofs (output_buildings) with an added attribute column containing the percentage of vegetated roof area with respect to total roof area. diff --git a/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs/r.extract.greenroofs.py b/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs/r.extract.greenroofs.py index 6feff7c..89a55f9 100644 --- a/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs/r.extract.greenroofs.py +++ b/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs/r.extract.greenroofs.py @@ -30,72 +30,74 @@ # % key: ndsm # % type: string # % required: yes -# % multiple: no -# % label: Name of the nDSM +# % label: Name of the nDSM raster +# % guisection: Input # %end # %option G_OPT_R_INPUT # % key: ndvi # % type: string # % required: yes -# % multiple: no # % label: Name of the NDVI raster +# % guisection: Input # %end # %option G_OPT_R_INPUT # % key: red # % type: string # % required: yes -# % multiple: no # % label: Name of the red DOP raster +# % guisection: Input # %end # %option G_OPT_R_INPUT # % key: green # % type: string # % required: yes -# % multiple: no # % label: Name of the green DOP raster +# % guisection: Input # %end # %option G_OPT_R_INPUT # % key: blue # % type: string # % required: yes -# % multiple: no # % label: Name of the blue DOP raster +# % guisection: Input # %end # %option G_OPT_V_INPUT # % key: fnk # % type: string # % required: no -# % multiple: no -# % label: Vector map containing Flaechennutzungskatalog +# % label: Vector map containing Flaechennutzungskartierung +# % guisection: Optional input +# % guidependency: fnk_column # %end -# %option +# %option G_OPT_DB_COLUMN # % key: fnk_column # % type: string # % required: no # % multiple: no # % label: Integer column containing FNK-code +# % guisection: Optional input # %end # %option G_OPT_V_INPUT # % key: buildings # % type: string # % required: yes -# % multiple: no # % label: Vector map containing outlines of buildings +# % guisection: Input # %end # %option G_OPT_V_INPUT # % key: trees # % type: string # % required: no -# % multiple: no # % label: Vector map containing tree polygons +# % guisection: Optional input # %end # %option @@ -103,7 +105,8 @@ # % type: integer # % required: no # % multiple: no -# % label: Define fix Green_blue_ratio threshold (on a scale from 0-255) +# % label: Define fix Green-Blue-Ratio threshold (on a scale from 0-255) +# % guisection: Parameters # %end # %option @@ -111,7 +114,8 @@ # % type: integer # % required: no # % multiple: no -# % label: Define Green_blue_ratio threshold as this percentile of green areas +# % label: Define Green-Blue-Ratio threshold as this percentile of green areas +# % guisection: Parameters # %end # %option @@ -121,6 +125,7 @@ # % multiple: no # % label: Minimum size of roof vegetation in sqm # % answer: 5 +# % guisection: Parameters # %end # %option @@ -130,28 +135,31 @@ # % multiple: no # % label: Minimum percentage of vegetation cover on roof # % answer: 10 -# %end - -# %option G_OPT_MEMORYMB -# %end - -# %option G_OPT_M_NPROCS -# % description: Number of cores for multiprocessing, -2 is the number of available cores - 1 -# % answer: -2 +# % guisection: Parameters # %end # %option G_OPT_V_OUTPUT # % key: output_buildings # % required: yes -# % multiple: no # % label: Name of output building vector map +# % guisection: Output # %end # %option G_OPT_V_OUTPUT # % key: output_vegetation # % required: yes -# % multiple: no # % label: Name of output roof vegetation vector map +# % guisection: Output +# %end + +# %option G_OPT_MEMORYMB +# % guisection: Parallel processing +# %end + +# %option G_OPT_M_NPROCS +# % label: Number of cores for multiprocessing, -2 is the number of available cores - 1 +# % answer: -2 +# % guisection: Parallel processing # %end # %option @@ -161,11 +169,13 @@ # % multiple: no # % label: Define edge length of grid tiles for parallel processing # % answer: 1000 +# % guisection: Parallel processing # %end # %flag # % key: s -# % description: Segment image based on nDSM, NDVI and blue/green ratio before green roof extraction +# % label: Segment image based on nDSM, NDVI and blue/green ratio before green roof extraction +# % guisection: Parameters # %end # %rules diff --git a/grass-gis-addons/m.analyse.buildings/v.cd.areas.worker/v.cd.areas.worker.py b/grass-gis-addons/m.analyse.buildings/v.cd.areas.worker/v.cd.areas.worker.py index e61cc4c..11f270e 100644 --- a/grass-gis-addons/m.analyse.buildings/v.cd.areas.worker/v.cd.areas.worker.py +++ b/grass-gis-addons/m.analyse.buildings/v.cd.areas.worker/v.cd.areas.worker.py @@ -22,21 +22,8 @@ # % keyword: vector # % keyword: classification # % keyword: statistics -# % keyword: buildings analysis # % keyword: change detection -# %end - -# %option G_OPT_V_INPUT -# %label: Name of the input vector layer -# %end - -# %option G_OPT_V_INPUT -# % key: reference -# % label: Name of the reference vector layer -# %end - -# %option G_OPT_V_OUTPUT -# % guisection: Output +# % keyword: worker # %end # %option @@ -50,10 +37,22 @@ # %option G_OPT_V_INPUT # % key: area -# % multiple: no # % description: Input natural tiles as vector map # %end +# %option G_OPT_V_INPUT +# %label: Name of the input vector layer +# %end + +# %option G_OPT_V_INPUT +# % key: reference +# % label: Name of the reference vector layer +# %end + +# %option G_OPT_V_OUTPUT +# % guisection: Output +# %end + # %flag # % key: q # % description: Calculate quality measures completeness and correctness diff --git a/grass-gis-addons/m.analyse.buildings/v.cd.areas/v.cd.areas.py b/grass-gis-addons/m.analyse.buildings/v.cd.areas/v.cd.areas.py index bdc20d6..d1a6fb7 100644 --- a/grass-gis-addons/m.analyse.buildings/v.cd.areas/v.cd.areas.py +++ b/grass-gis-addons/m.analyse.buildings/v.cd.areas/v.cd.areas.py @@ -28,11 +28,13 @@ # %option G_OPT_V_INPUT # %label: Name of the input vector layer +# % guisection: Input # %end # %option G_OPT_V_INPUT # % key: reference # % label: Name of the reference vector layer +# % guisection: Input # %end # %option @@ -42,6 +44,7 @@ # % multiple: no # % label: Minimum size of identified change areas in sqm # % answer: 5 +# % guisection: Parameters # %end # %option @@ -51,6 +54,7 @@ # % multiple: no # % label: Maximum value of fractal dimension of identified change areas (see v.to.db) # % answer: 2.5 +# % guisection: Parameters # %end # %option G_OPT_V_OUTPUT @@ -58,8 +62,9 @@ # %end # %option G_OPT_M_NPROCS -# % description: Number of cores for multiprocessing, -2 is the number of available cores - 1 +# % label: Number of cores for multiprocessing, -2 is the number of available cores - 1 # % answer: -2 +# % guisection: Parallel processing # %end # %option @@ -69,11 +74,13 @@ # % multiple: no # % label: Define edge length of grid tiles for parallel processing # % answer: 1000 +# % guisection: Parallel processing # %end # %flag # % key: q -# % description: Calculate quality measures completeness and correctness +# % label: Calculate quality measures completeness and correctness +# % guisection: Parameters # %end From 5eb5ef2d0f878230a7052dfc900be50f4607abb4 Mon Sep 17 00:00:00 2001 From: Julia Haas Date: Tue, 2 Jan 2024 16:28:41 +0100 Subject: [PATCH 3/4] linting --- .../r.extract.greenroofs.worker.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py b/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py index 65760ce..4890dab 100644 --- a/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py +++ b/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py @@ -154,7 +154,7 @@ # %flag # % key: t -# % label: Use trees for the selection +# % label: Use trees for the selection # %end # %rules @@ -352,9 +352,7 @@ def main(): ) grass.run_command("r.mapcalc", expression=extract_exp, quiet=True) - pot_veg_rast_range = grass.parse_command( - "r.info", map=pot_veg_rast, flags="r" - ) + pot_veg_rast_range = grass.parse_command("r.info", map=pot_veg_rast, flags="r") if pot_veg_rast_range["min"] == pot_veg_rast_range["max"] == "NULL": print( f"r.extract.greenroofs.worker skipped for buildings in tile {num}:" @@ -555,23 +553,17 @@ def main(): # vegetation elements) res_list = [] veg_list = [] - unique_bu_cats = list( - set([item["building_cat"] for item in building_dicts]) - ) + unique_bu_cats = list(set([item["building_cat"] for item in building_dicts])) for building_cat in unique_bu_cats: unique_segs = [ - item - for item in building_dicts - if item["building_cat"] == building_cat + item for item in building_dicts if item["building_cat"] == building_cat ] bu_rest_size = unique_segs[0]["bu_rest_size"] total_veg_size = sum([item["seg_size"] for item in unique_segs]) seg_cats = [item["seg_cat"] for item in unique_segs] proportion = total_veg_size / (bu_rest_size + total_veg_size) * 100 if proportion >= min_veg_proportion: - res_list.append( - {"building_cat": building_cat, "proportion": proportion} - ) + res_list.append({"building_cat": building_cat, "proportion": proportion}) veg_list.extend(seg_cats) if len(veg_list) > 0: From b7eb578bb98082d8d5fe4c27fb1106a25b50f2cc Mon Sep 17 00:00:00 2001 From: Julia Haas Date: Tue, 2 Jan 2024 16:30:44 +0100 Subject: [PATCH 4/4] linting --- .../r.extract.greenroofs.worker.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py b/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py index 4890dab..474d4e6 100644 --- a/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py +++ b/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py @@ -352,7 +352,9 @@ def main(): ) grass.run_command("r.mapcalc", expression=extract_exp, quiet=True) - pot_veg_rast_range = grass.parse_command("r.info", map=pot_veg_rast, flags="r") + pot_veg_rast_range = grass.parse_command( + "r.info", map=pot_veg_rast, flags="r" + ) if pot_veg_rast_range["min"] == pot_veg_rast_range["max"] == "NULL": print( f"r.extract.greenroofs.worker skipped for buildings in tile {num}:" @@ -553,17 +555,23 @@ def main(): # vegetation elements) res_list = [] veg_list = [] - unique_bu_cats = list(set([item["building_cat"] for item in building_dicts])) + unique_bu_cats = list( + set([item["building_cat"] for item in building_dicts]) + ) for building_cat in unique_bu_cats: unique_segs = [ - item for item in building_dicts if item["building_cat"] == building_cat + item + for item in building_dicts + if item["building_cat"] == building_cat ] bu_rest_size = unique_segs[0]["bu_rest_size"] total_veg_size = sum([item["seg_size"] for item in unique_segs]) seg_cats = [item["seg_cat"] for item in unique_segs] proportion = total_veg_size / (bu_rest_size + total_veg_size) * 100 if proportion >= min_veg_proportion: - res_list.append({"building_cat": building_cat, "proportion": proportion}) + res_list.append( + {"building_cat": building_cat, "proportion": proportion} + ) veg_list.extend(seg_cats) if len(veg_list) > 0: