[GRASS-dev] [GRASS GIS] #134: Add a flag for subgroup listing in i.group

#134: Add a flag for subgroup listing in i.group
-------------------------+--------------------------------------------------
Reporter: nikos | Owner: grass-dev@lists.osgeo.org
     Type: enhancement | Status: new
Priority: major | Milestone: 6.4.0
Component: default | Version: unspecified
Keywords: |
-------------------------+--------------------------------------------------
How do you list your subgroup's?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/134&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#134: Add a flag for subgroup listing in i.group
--------------------------+-------------------------------------------------
  Reporter: nikos | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: unspecified
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Comment (by neteler):

Currently i.group seems to be broken for subgroups. Otherwise -l should
list
them AFAIK.

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/134#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#134: Add a flag for subgroup listing in i.group
--------------------------+-------------------------------------------------
  Reporter: nikos | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: unspecified
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Comment (by glynn):

Replying to [comment:1 neteler]:

> Currently i.group seems to be broken for subgroups. Otherwise -l should
list
> them AFAIK.

No, -l doesn't list subgroups, only files. Essentially, it dumps the
contents of the REF file for either a group or subgroup (depending upon
whether subgroup= was given).

You can list groups with "g.list group", but there doesn't appear to be
any way to list the subgroups of a group.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/134#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#134: Add a flag for subgroup listing in i.group
--------------------------+-------------------------------------------------
  Reporter: nikos | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: unspecified
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Comment (by neteler):

With fixed i.group, it is possible but too complicated to list subgroups:

{{{
location: nc_spm_07
mapset: landsat

i.group mylsat7_2000 sub=mylsat7_2000
in=lsat7_2000_10,lsat7_2000_20,lsat7_2000_30,lsat7_2000_40,lsat7_2000_50,lsat7_2000_61,lsat7_2000_70,lsat7_2000_80

i.group -l mylsat7_2000
group [mylsat7_2000] references the following cellfiles
-------------
lsat7_2000_10 in landsat lsat7_2000_20 in landsat
lsat7_2000_30 in landsat lsat7_2000_40 in landsat
lsat7_2000_50 in landsat lsat7_2000_61 in landsat
lsat7_2000_70 in landsat lsat7_2000_80 in landsat
-------------
i.group complete.
}}}
-> subgroups missing, not even indicated that they are present in that
group.
"g.list subgroup" does not exist.

{{{
i.group -l mylsat7_2000 subgroup=mylsat7_2000
subgroup [mylsat7_2000] of group [mylsat7_2000] references the following
cellfiles
-------------
lsat7_2000_10 in landsat lsat7_2000_20 in landsat
lsat7_2000_30 in landsat lsat7_2000_40 in landsat
lsat7_2000_50 in landsat lsat7_2000_61 in landsat
lsat7_2000_70 in landsat lsat7_2000_80 in landsat
-------------
i.group complete.
}}}

Now '''only''' the subgroups are listed. But how to know its name to issue
this command?

I see some conceptual problems here. Proposal

- either list automatically also the subgroup(s) when only indicating
group=

- or add a new flag for subgroup(s) listing

- or enhance g.list to ist subgroup names (but looks moreover confusig to
me).

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/134#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#134: Add a flag for subgroup listing in i.group
--------------------------+-------------------------------------------------
  Reporter: nikos | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: unspecified
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Comment (by glynn):

Replying to [comment:3 neteler]:

> With fixed i.group, it is possible but too complicated to list
subgroups:

Let me clarify. You can list the files which make up a subgroup, but you
cannot list the subgroups of a group.

> -> subgroups missing, not even indicated that they are present in that
group.

The -l switch just dumps the REF file for a group or subgroup.

> "g.list subgroup" does not exist.

Well, each group has its own list of subgroups. g.list only lists "top-
level" entities (rasters, vectors, groups, etc).

> Now '''only''' the subgroups are listed.

Only the contents of a specific subgroup are listed. Adding subgroup=
causes -l to
dump that subgroup's REF file rather than the group's REF file.

> But how to know its name to issue this command?

Exactly.

> I see some conceptual problems here. Proposal
>
> - either list automatically also the subgroup(s) when only indicating
group=

That could be confusing, particularly if you have scripts parsing the
output of "i.group -l".

> - or add a new flag for subgroup(s) listing

That seems like the most viable solution. And there is actually a function
to do this, named I_list_subgroups(), although nothing uses it at present.

FWIW, there is also I_list_groups(), but the only thing which uses it is
I_ask_group_old() (if you type "list"), which in turn is only used by the
i.ortho.photo front-end.

Both of those functions are abominations which uses popen("ls ...") to
enumerate the directory. They also do all of the formatting, and send the
results to the pager. There isn't anything like I_get_[sub]group_ref()
which just returns the information to the caller in a usable form.

> - or enhance g.list to ist subgroup names (but looks moreover confusig
to me).

You would need to add a group= parameter to g.list, unless you want it to
enumerate all subgroups of all groups. But that's arguably outside of the
scope of g.list, which isn't supposed to know the details of the various
entity types (it violates that principle for vectors, although I'm not
sure if that's really necessary).

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/134#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#134: Add a flag for subgroup listing in i.group
--------------------------+-------------------------------------------------
  Reporter: nikos | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: unspecified
Resolution: | Keywords:
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by hamish):

  * platform: => Unspecified
  * cpu: => Unspecified

Comment:

see also duplicate in #324

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/134#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#134: Add a flag for subgroup listing in i.group
-------------------------+--------------------------------------------------
Reporter: nikos | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: major | Milestone: 6.4.4
Component: Imagery | Version: unspecified
Keywords: i.group | Platform: All
      Cpu: All |
-------------------------+--------------------------------------------------
Changes (by hamish):

  * keywords: => i.group
  * platform: Unspecified => All
  * component: Default => Imagery
  * cpu: Unspecified => All
  * milestone: 6.4.0 => 6.4.4

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/134#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#134: Add a flag for subgroup listing in i.group
-------------------------+--------------------------------------------------
Reporter: nikos | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: major | Milestone: 6.4.4
Component: Imagery | Version: unspecified
Keywords: i.group | Platform: All
      Cpu: All |
-------------------------+--------------------------------------------------

Comment(by turek):

Hi,

I have added (r57704 and r57703) -s flag into G7 i.group module, which
lists subgroups in group.

Stepan

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/134#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#134: Add a flag for subgroup listing in i.group
--------------------------+-------------------------------------------------
  Reporter: nikos | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: major | Milestone: 7.0.0
Component: Imagery | Version: unspecified
Resolution: fixed | Keywords: i.group
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Changes (by nikos):

  * status: new => closed
  * resolution: => fixed
  * milestone: 6.4.4 => 7.0.0

Comment:

Thanks Stepan, works perfectly in both (G71 and G7).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/134#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>