diff --git a/.flake8 b/.flake8 index 03cdcd09630..3476465bf26 100644 --- a/.flake8 +++ b/.flake8 @@ -196,7 +196,7 @@ per-file-ignores = scripts/r.in.wms/wms_cap_parsers.py: F841, E741, E501 scripts/r.in.wms/wms_drv.py: E402, E722, E501 scripts/r.in.wms/srs.py: E722, E501 - scripts/i.band/i.band.py: F841, E501 + scripts/r.semantic.label/r.semantic.label.py: F841, E501 scripts/v.report/v.report.py: F841, E501 scripts/db.out.ogr/db.out.ogr.py: F841 scripts/g.extension/g.extension.py: F841, E722, E501 diff --git a/python/grass/semantic_label/reader.py b/python/grass/semantic_label/reader.py index 73bf70d7359..3af558eccf6 100644 --- a/python/grass/semantic_label/reader.py +++ b/python/grass/semantic_label/reader.py @@ -23,7 +23,7 @@ class SemanticLabelReader: def __init__(self): self._json_files = glob.glob( - os.path.join(os.environ["GISBASE"], "etc", "g.bands", "*.json") + os.path.join(os.environ["GISBASE"], "etc", "i.band.library", "*.json") ) if not self._json_files: raise SemanticLabelReaderError("No semantic label definitions found") diff --git a/scripts/Makefile b/scripts/Makefile index 6ade1f78bfc..2855c6018a3 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -18,14 +18,13 @@ SUBDIRS = \ db.out.ogr \ db.test \ db.univar \ - g.bands \ g.download.location \ g.extension \ g.extension.all \ g.manual \ g.search.modules \ + i.band.library \ i.colors.enhance \ - i.band \ i.image.mosaic \ i.in.spotvgt \ i.oif \ @@ -50,6 +49,7 @@ SUBDIRS = \ r.plane \ r.reclass.area \ r.rgb \ + r.semantic.label \ r.shade \ r.tileset \ r.unpack \ diff --git a/scripts/g.bands/Makefile b/scripts/i.band.library/Makefile similarity index 96% rename from scripts/g.bands/Makefile rename to scripts/i.band.library/Makefile index 1040e8f6862..4ca53920119 100644 --- a/scripts/g.bands/Makefile +++ b/scripts/i.band.library/Makefile @@ -1,6 +1,6 @@ MODULE_TOPDIR = ../.. -PGM = g.bands +PGM = i.band.library # TODO: unfortunately Script.make assumes that ETCFILES are Python # modules only, this should be improved (by introducing a new variable diff --git a/scripts/g.bands/g.bands.html b/scripts/i.band.library/i.band.library.html similarity index 86% rename from scripts/g.bands/g.bands.html rename to scripts/i.band.library/i.band.library.html index 4083857b58a..ae790dfe1cb 100644 --- a/scripts/g.bands/g.bands.html +++ b/scripts/i.band.library/i.band.library.html @@ -1,6 +1,6 @@

DESCRIPTION

-g.bands prints available band references information of multispectral data +i.band.library prints available band information of multispectral data defined by GRASS GIS. The following multispectral sensors are supported by default (other band reference registry files can be added, see below): @@ -75,19 +75,27 @@

DESCRIPTION

by pattern option. For pattern syntax see Python regular expression operations documentation. By -default, g.bands prints all available band references. +default, i.band.library prints all available band references.

Extended metadata (central wavelength, spatial resolution, etc.) is printed only when the -e flag is given. -

NOTES

+

Band reference and semantic label relation

+ +

+Band references are a special case (a subset) of semantic labels. +Any string can be a semantic label but strings identifying specific +remote sensing platform bands (=band references) +can have additional metadata managed by i.band.library. +Specific band reference can be assigned to a raster map as a semantic +label by r.semantic.label +or r.support modules. -Specific band reference can be assigned to a raster map -by i.band module. +

NOTES

-Band reference concept is supported by temporal GRASS modules, +Semantic label concept is supported by temporal GRASS modules, see t.register, t.rast.list, t.info @@ -102,7 +110,7 @@

Image collections

Earth Engine API for example) to address multi spectral satellite images series. GRASS supports a multi-band raster layer approach basically with the imagery group concept -(i.group). A new band reference +(i.group). A new semantic label concept is designed in order to support image collections in GRASS GIS. @@ -169,8 +177,8 @@

Band reference registry files

System-defined registry files are located in GRASS GIS installation -directory ($GISBASE/etc/g.bands). Note that -currently g.bands allows to manage only system-defined registry +directory ($GISBASE/etc/i.band.library). Note that +currently i.band.library allows to manage only system-defined registry files. Support for user-defined registry files is planned to be implemented, see KNOWN ISSUES section for details. @@ -180,7 +188,7 @@

EXAMPLES

Print all available band references

-g.bands
+i.band.library
 
 S2_1 Visible (Coastal/Aerosol)
 S2_2 Visible (Blue)
@@ -201,7 +209,7 @@ 

Filter band references by a shortcut

printed.
-g.bands pattern=S2
+i.band.library pattern=S2
 
 S2_1 Visible (Coastal/Aerosol)
 ...
@@ -213,7 +221,7 @@ 

Filter band references by a regular expression

Print all available 2nd bands:
-g.bands pattern=.*_2
+i.band.library pattern=.*_2
 
 S2_2 Visible (Blue)
 L7_2 Visible (Green)
@@ -227,7 +235,7 @@ 

Print extended metadata for specified band identifier

will be printed.
-g.bands -e pattern=S2_1
+i.band.library -e pattern=S2_1
 
 description: The Sentinel-2 A/B bands
 shortcut: S2
@@ -247,7 +255,7 @@ 

Print extended metadata for specified band identifier

KNOWN ISSUES

-g.bands has currently very limited functionality. Only +i.band.library has currently very limited functionality. Only system-defined band references are supported. The final implementation will support managing (add, modify, delete) user-defined band references. @@ -266,7 +274,7 @@

REFERENCES

SEE ALSO

- i.band, + r.semantic.label, r.info diff --git a/scripts/g.bands/g.bands.py b/scripts/i.band.library/i.band.library.py similarity index 98% rename from scripts/g.bands/g.bands.py rename to scripts/i.band.library/i.band.library.py index 1552c2eca4e..7d7b43739b1 100644 --- a/scripts/g.bands/g.bands.py +++ b/scripts/i.band.library/i.band.library.py @@ -2,7 +2,7 @@ ############################################################################ # -# MODULE: g.bands +# MODULE: i.band.library # AUTHOR(S): Martin Landa # # PURPOSE: Prints available semantic label information used for multispectral data. diff --git a/scripts/g.bands/landsat.json b/scripts/i.band.library/landsat.json similarity index 100% rename from scripts/g.bands/landsat.json rename to scripts/i.band.library/landsat.json diff --git a/scripts/g.bands/sentinel.json b/scripts/i.band.library/sentinel.json similarity index 100% rename from scripts/g.bands/sentinel.json rename to scripts/i.band.library/sentinel.json diff --git a/scripts/g.bands/testsuite/test_g_bands.py b/scripts/i.band.library/testsuite/test_i_band_library.py similarity index 90% rename from scripts/g.bands/testsuite/test_g_bands.py rename to scripts/i.band.library/testsuite/test_i_band_library.py index 697389ca510..7d55ecff9ff 100644 --- a/scripts/g.bands/testsuite/test_g_bands.py +++ b/scripts/i.band.library/testsuite/test_i_band_library.py @@ -8,12 +8,12 @@ class TestBandsSystemDefined(TestCase): @staticmethod def _number_of_bands(**kwargs): - gbands = call_module("g.bands", **kwargs) + gbands = call_module("i.band.library", **kwargs) return len(gbands.rstrip(os.linesep).split(os.linesep)) def test_number_system_defined(self): """Test number of valid band identifiers""" - # get number of valid band identifiers by g.bands + # get number of valid band identifiers by i.band.library nbands = self._number_of_bands() # get number of valid band identifiers by Bands lib diff --git a/scripts/i.band/Makefile b/scripts/r.semantic.label/Makefile similarity index 79% rename from scripts/i.band/Makefile rename to scripts/r.semantic.label/Makefile index 0509a71bf76..4c8d9f8f6f8 100644 --- a/scripts/i.band/Makefile +++ b/scripts/r.semantic.label/Makefile @@ -1,6 +1,6 @@ MODULE_TOPDIR = ../.. -PGM = i.band +PGM = r.semantic.label include $(MODULE_TOPDIR)/include/Make/Script.make diff --git a/scripts/i.band/i.band.html b/scripts/r.semantic.label/r.semantic.label.html similarity index 74% rename from scripts/i.band/i.band.html rename to scripts/r.semantic.label/r.semantic.label.html index 5a10f90f28d..e46abd7b0e6 100644 --- a/scripts/i.band/i.band.html +++ b/scripts/r.semantic.label/r.semantic.label.html @@ -1,6 +1,6 @@

DESCRIPTION

-i.band allows assigning a semantic label information to a +r.semantic.label allows assigning a semantic label information to a single raster map or to a list of specified raster maps. Semantic label can be defined by semantic_label option. Already assigned semantic label can be removed from a specified raster map @@ -19,7 +19,7 @@

NOTES

For more information about semantic label concept and supported sensors (generic multispectral system, Landsat-5, Landsat-7, Landsat-8, Sentinel-2) -see the g.bands module. +see the i.band.library module.

Semantic labels are supported by temporal GRASS modules. Name of @@ -36,48 +36,48 @@

EXAMPLES

Assign semantic label to a single raster map

-i.band map=T33UVR_20180506T100031_B01 semantic_label=S2_1
+r.semantic.label map=T33UVR_20180506T100031_B01 semantic_label=S2_1
 

Assign semantic label to a list of raster maps

-i.band map=T33UVR_20180506T100031_B01,T33UVR_20180521T100029_B01 semantic_label=S2_1,S2_1
+r.semantic.label map=T33UVR_20180506T100031_B01,T33UVR_20180521T100029_B01 semantic_label=S2_1,S2_1
 

Assign different semantic labels to a list of raster maps

-i.band map=T33UVR_20180506T100031_B01,T33UVR_20180506T100031_B02 semantic_label=S2_1,S2_2
+r.semantic.label map=T33UVR_20180506T100031_B01,T33UVR_20180506T100031_B02 semantic_label=S2_1,S2_2
 

Remove semantic label from a list of raster maps

-i.band map=T33UVR_20180506T100031_B01,T33UVR_20180506T100031_B02 operation=remove
+r.semantic.label map=T33UVR_20180506T100031_B01,T33UVR_20180506T100031_B02 operation=remove
 

Print semantic label information about single raster map

-i.band map=T33UVR_20180506T100031_B01 operation=print
+r.semantic.label map=T33UVR_20180506T100031_B01 operation=print
 

Print extended semantic label information for a list of raster map

-i.band map=T33UVR_20180506T100031_B01,T33UVR_20180506T100031_B02 operation=print
+r.semantic.label map=T33UVR_20180506T100031_B01,T33UVR_20180506T100031_B02 operation=print
 

KNOWN ISSUES

-i.band allows managing semantic labels only related to 2D +r.semantic.label allows managing semantic labels only related to 2D raster maps.

SEE ALSO

- g.bands, + i.band.library, r.info, r.support diff --git a/scripts/i.band/i.band.py b/scripts/r.semantic.label/r.semantic.label.py similarity index 99% rename from scripts/i.band/i.band.py rename to scripts/r.semantic.label/r.semantic.label.py index 74bb86ac2a0..a8714d494dd 100644 --- a/scripts/i.band/i.band.py +++ b/scripts/r.semantic.label/r.semantic.label.py @@ -2,7 +2,7 @@ ############################################################################ # -# MODULE: i.band +# MODULE: r.semantic.label # AUTHOR(S): Martin Landa # # PURPOSE: Manages semantic label information assigned to a single diff --git a/scripts/i.band/testsuite/test_i_band.py b/scripts/r.semantic.label/testsuite/test_r_semantic_label.py similarity index 87% rename from scripts/i.band/testsuite/test_i_band.py rename to scripts/r.semantic.label/testsuite/test_r_semantic_label.py index 2db92aa081e..16ffb79c3d5 100644 --- a/scripts/i.band/testsuite/test_i_band.py +++ b/scripts/r.semantic.label/testsuite/test_r_semantic_label.py @@ -33,13 +33,13 @@ def test_semantic_label_assign_not_current_mapset(self): self.mapset.name = "PERMANENT" a_map = self.mapset.glist(type="raster")[0] module = SimpleModule( - "i.band", map=a_map, semantic_label=self.semantic_label + "r.semantic.label", map=a_map, semantic_label=self.semantic_label ) self.assertModuleFail(module) def test_semantic_label_assign(self): module = SimpleModule( - "i.band", map=self.map, semantic_label=self.semantic_label + "r.semantic.label", map=self.map, semantic_label=self.semantic_label ) self.assertModule(module) @@ -47,7 +47,7 @@ def test_semantic_label_assign(self): self.assertEqual(self.read_semantic_label(), self.semantic_label) def test_semantic_label_dissociate(self): - module = SimpleModule("i.band", operation="remove", map=self.map) + module = SimpleModule("r.semantic.label", operation="remove", map=self.map) self.assertModule(module) # check also using pygrass diff --git a/temporal/t.info/t.info.html b/temporal/t.info/t.info.html index 534e1d9c7dd..b6e602de8ab 100644 --- a/temporal/t.info/t.info.html +++ b/temporal/t.info/t.info.html @@ -140,7 +140,7 @@

Temporal maps information

Space time dataset with semantic labels assigned

This information is printed only when semantic labels have been assigned -to registered raster maps by i.band +to registered raster maps by r.semantic.label or t.register module.
diff --git a/temporal/t.rast.list/t.rast.list.html b/temporal/t.rast.list/t.rast.list.html
index 4572376d7f7..15912b74588 100644
--- a/temporal/t.rast.list/t.rast.list.html
+++ b/temporal/t.rast.list/t.rast.list.html
@@ -187,7 +187,7 @@ 

Using method option

Filtering the result by semantic label

Semantic label can be assigned to raster maps -by i.band module or even when +by r.semantic.label module or even when registrating raster maps into STRDS by t.register. @@ -206,7 +206,7 @@

Filtering the result by semantic label

Also note that only STRDS can be filtered by semantic label, -see i.band for +see r.semantic.label for current limitations. diff --git a/temporal/t.rast.mapcalc/t.rast.mapcalc.html b/temporal/t.rast.mapcalc/t.rast.mapcalc.html index 0f26c582ffc..dba06ed1ee6 100644 --- a/temporal/t.rast.mapcalc/t.rast.mapcalc.html +++ b/temporal/t.rast.mapcalc/t.rast.mapcalc.html @@ -165,7 +165,7 @@

Semantic label filtering

For more information about semantic label concept -see g.bands module. +see i.band.library module.

SEE ALSO

diff --git a/temporal/t.register/t.register.html b/temporal/t.register/t.register.html index ba797f15212..d958f2ffcb4 100644 --- a/temporal/t.register/t.register.html +++ b/temporal/t.register/t.register.html @@ -116,7 +116,7 @@

INPUT FILE FORMAT

Support for semantic labels

For more information about semantic labels and image collections -see g.bands module. +see i.band.library module.

Specification of map names and absolute start time (datetime) of the time @@ -139,7 +139,7 @@

Support for semantic labels

In this case t.register assigns to given raster maps a semantic label similarly as -i.band does. +r.semantic.label does. Such registered raster maps is possible to filter diff --git a/temporal/t.upgrade/t.upgrade.html b/temporal/t.upgrade/t.upgrade.html index 24e53c7710b..aeb432caead 100644 --- a/temporal/t.upgrade/t.upgrade.html +++ b/temporal/t.upgrade/t.upgrade.html @@ -3,7 +3,7 @@

DESCRIPTION

This module upgrades the temporal database in the current mapset from version 2 (default in GRASS 7) to 3 (default in GRASS 8). The version 3 introduces a semantic label support, see -
g.bands for details. +i.band.library for details.

EXAMPLE