OSGeo / grass

GRASS GIS - free and open-source geospatial processing engine
https://grass.osgeo.org
Other
852 stars 309 forks source link

[Bug] g.search.modules struggles with multi-addons like i.sentinel #514

Closed neteler closed 2 years ago

neteler commented 4 years ago

Describe the bug

g.search.modules is not able to find multi-addons like i.sentinel.*:

GRASS 7.8.3dev (nc_spm_08):~ > g.search.modules sentinel

i.sentinel
    keywords: None
    description: None

The result should be

i.sentinel.download  ...
i.sentinel.import ...
i.sentinel.mask ...
i.sentinel.preproc ...

Any ideas how to support multi-modules?

lucadelu commented 4 years ago

Describe the bug

g.search.modules is not able to find multi-addons like i.sentinel.*:

GRASS 7.8.3dev (nc_spm_08):~ > g.search.modules sentinel

i.sentinel
    keywords: None
    description: None

The result should be

i.sentinel.download  ...
i.sentinel.import ...
i.sentinel.mask ...
i.sentinel.preproc ...

Any ideas how to support multi-modules?

Are you sure that the output should list all the four modules? is it possible to install them one by one? Because I think it is correct to show only i.sentinel since it install all four modules.

Maybe could be better to have an output like:

i.sentinel

  * i.sentinel.download
  * i.sentinel.impor
  * i.sentinel.mask
  * i.sentinel.preproc
wenzeslaus commented 4 years ago

I think g.search.module should operate on modules, so i.sentinel.download, i.sentinel.mask, etc. If it shows one or more of these should be determined by whether the module matches the criteria.

How you install them is secondary. If they would be on code there would be no i.sentinel except for perhaps source code. I think we need to handle these multi-module addons (or whatever we call these) in a better way and clearly this is one case, I just think what use sees here (since it is already installed), it should be just modules.

metzm commented 4 years ago

A solution would be to distinguish between extensions and modules installed by extensions. Generally, an extension is a single module, but not always, and it seems that these cases are increasing, e.g. i.ann.maskrcnn, i.modis, i.pr, i.sentinel, r.agent, r.connectivity, r.learn.ml2.

g.extension needs to be updated to distinguish between extensions and modules provided by extensions.

I am preparing a PR for g.extension doing this. Most importantly, there will be a new xml file extensions.xml alongside the current modules.xml in GRASS_ADDON_BASE. The modules.xml file is currently supposed to list installed modules together with descriptions and keywords, but fails to do so for extensions that provide multiple modules. This will be fixed. The new extensions.xml file will contain all installed extensions together with the files installed by each extension (needed to uninstall an extension) and a list of modules installed by each extension.

neteler commented 4 years ago

Thanks for the fix, now it appears to be working as expected:

GRASS 7.8.4dev (nc_spm_08_grass7):~ > g.search.modules sentinel

i.sentinel
    keywords: None
    description: None

i.sentinel.download
    keywords: imagery,satellite,Sentinel,download
    description: Downloads Sentinel satellite data from Copernicus Open Access
                 Hub using sentinelsat library.

i.sentinel.import
    keywords: imagery,satellite,Sentinel,import
    description: Imports Sentinel satellite data downloaded from Copernicus
                 Open Access Hub using i.sentinel.download.

i.sentinel.mask
    keywords: imagery,satellite,Sentinel,cloud detection,shadow,reflectance
    description: Creates clouds and shadows masks for Sentinel-2 images.

i.sentinel.preproc
    keywords: imagery,satellite,Sentinel,download,import,atmospheric correction
    description: Imports and performs atmospheric correction of Sentinel-2
                 images.

More as cosmetics, could the first entry be skipped?

neteler commented 2 years ago

Meanwhile it works nicely:

GRASS nc_spm_08_grass7/user1:~ > g.search.modules sentinel

i.sentinel.coverage
    keywords: imagery,satellite,Sentinel,geometry,spatial query,area
    description: Checks the area coverage of Sentinel-1 or Sentinel-2 scenes
                 selected by filters.

i.sentinel.download
    keywords: imagery,satellite,Sentinel,download
    description: Downloads Sentinel satellite data from Copernicus Open Access
                 Hub, USGS Earth Explorer, or Google Cloud Storage.

i.sentinel.import
    keywords: imagery,satellite,Sentinel,import
    description: Imports Sentinel satellite data downloaded from Copernicus
                 Open Access Hub using i.sentinel.download.

i.sentinel.mask
    keywords: imagery,satellite,Sentinel,cloud detection,shadow,reflectance
    description: Creates clouds and shadows masks for Sentinel-2 images.

i.sentinel.parallel.download
    keywords: imagery,satellite,Sentinel,download,parallel
    description: Downloads Sentinel-2 images in parallel using
                 i.sentinel.download.

i.sentinel.preproc
    keywords: imagery,satellite,Sentinel,download,import,atmospheric correction
    description: Imports and performs atmospheric correction of Sentinel-2
                 images.

i.tasscap
    keywords: imagery,transformation,Landsat,MODIS,Worldview,Sentinel,Tasseled
              Cap transformation
    description: Performs Tasseled Cap (Kauth Thomas) transformation.