Skip to content

Commit

Permalink
GUI section for buildings analysis (#66)
Browse files Browse the repository at this point in the history
* add and sort keywords

* reorder parameters, add guisection, cleanup

* linting

* linting
  • Loading branch information
juleshaas authored Jan 3, 2024
1 parent 87179d8 commit ee1a180
Show file tree
Hide file tree
Showing 9 changed files with 130 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ <h2>DESCRIPTION</h2>
<em>r.extract.buildings.worker</em> is a worker module that is started by
<a href="r.extract.buildings.html">r.extract.buildings</a>. It extracts buildings
as vectors using an nDSM-raster, NDVI-raster, and FNK-vector
(Flaechennutzungskatalog).
(Flaechennutzungskartierung).

<h2>SEE ALSO</h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,48 +19,57 @@
# %Module
# % description: Extracts buildings from nDSM, NDVI and FNK.
# % keyword: raster
# % keyword: statistics
# % keyword: change detection
# % keyword: classification
# % keyword: statistics
# % 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

# %option G_OPT_R_INPUT
# % 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

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ <h2>DESCRIPTION</h2>
<em>r.extract.buildings</em> 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
<a href="i.segment.html">i.segment</a>, which requires the <b>-s</b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,41 +19,43 @@
# %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
# % 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
Expand All @@ -63,6 +65,7 @@
# % multiple: no
# % label: Minimum size of buildings in sqm
# % answer: 20
# % guisection: Parameters
# %end

# %option
Expand All @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,9 +19,9 @@
# %Module
# % description: Worker GRASS GIS addon to extract greenroofs.
# % keyword: raster
# % keyword: statistics
# % keyword: greenroofs
# % keyword: classification
# % keyword: statistics
# % keyword: worker
# %end

# %option
Expand All @@ -36,66 +36,55 @@
# % key: area
# % type: string
# % required: yes
# % multiple: no
# % label: Vector map containing area
# %end

# %option G_OPT_V_INPUT
# % key: building_outlines
# % type: string
# % required: yes
# % multiple: no
# % label: Vector map containing outlines of buildings
# %end

# %option G_OPT_R_INPUT
# % 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

# %option G_OPT_R_INPUT
# % key: gb_ratio
# % type: string
# % required: yes
# % multiple: no
# % label: Name of the GB-ratio raster
# %end

# %option G_OPT_R_INPUT
# % key: rg_ratio
# % type: string
# % required: yes
# % multiple: no
# % label: Name of the RG-ratio raster
# %end

# %option G_OPT_R_INPUT
# % key: brightness
# % type: string
# % required: yes
# % multiple: no
# % label: Name of the brightness raster
# %end

# %option G_OPT_R_INPUT
# % key: ndvi
# % type: string
# % required: yes
# % multiple: no
# % label: Name of the NDVI raster
# %end

Expand Down Expand Up @@ -152,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ <h2>DESCRIPTION</h2>

<em>r.extract.greenroofs</em> 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
(<em>output_buildings</em>) with an added attribute column containing
the percentage of vegetated roof area with respect to total roof area.
Expand Down
Loading

0 comments on commit ee1a180

Please sign in to comment.