[GRASS-dev] [GRASS GIS] #2818: wxgui: maps ordered using "natural sort"

#2818: wxgui: maps ordered using "natural sort"
-------------------------+-------------------------
Reporter: pmav99 | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.3
Component: wxGUI | Version: unspecified
Keywords: | CPU: Unspecified
Platform: Unspecified |
-------------------------+-------------------------
I think that it would be really useful in the GUI to get the maps to be
ordered using natural sort[1]. This would be particularly useful in tools
like `g.gui.animation` where you have to manually order the maps if they
are named with an integer suffix. For example, now, if you have these
maps:

{{{
map_1, map_2, ..., map_10, map_11, ..., map_100, ..., map_200
}}}

when you try to add them using "multiple add" you get something like this:

{{{
map_1, map_10, map_100, map_101, map_102, ..., map_19, map_2, map_20,
map_200, map_21, map_22, ...,
}}}

and this is not usually the animation you intend to create.

Other places where I think that this functionality would also be useful is
things like `Map Layer` in the wxgui and also `g.list`.

WRT to implementation, in python there is the `natsort` package[2] which
is by far the most flexible solution, but it is rather trivial to
implement a subset of the package's functionality on your own (e.g. [3]
and [4]).

[1] https://en.wikipedia.org/wiki/Natural_sort_order
[2] https://pypi.python.org/pypi/natsort
[3] http://stackoverflow.com/a/4836734/592289
[4] http://stackoverflow.com/a/5967539/592289

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2818&gt;
GRASS GIS <https://grass.osgeo.org>

#2818: wxgui: maps ordered using "natural sort"
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.0.3
Component: wxGUI | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by annakrat):

Implemented in r67070 with one of the simple implementations. Map
selection widget and Add multiple maps dialog are using it. Please test.

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

#2818: wxgui: maps ordered using "natural sort"
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.0.4
Component: wxGUI | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by neteler):

pmav99: Can r67070 be backported, works?

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

#2818: wxgui: maps ordered using "natural sort"
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.0.4
Component: wxGUI | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by annakrat):

Replying to [comment:4 neteler]:
> pmav99: Can r67070 be backported, works?

yes, after release.

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

#2818: wxgui: maps ordered using "natural sort"
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.0.4
Component: wxGUI | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by pmav99):

I just tried the patch on `releasebranch_7_0` and it applies cleanly. The
functionality is also working as expected.

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

#2818: wxgui: maps ordered using "natural sort"
--------------------------+-------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: normal | Milestone: 7.0.4
Component: wxGUI | Version: unspecified
Resolution: fixed | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Changes (by annakrat):

* status: new => closed
* resolution: => fixed

Comment:

Backported in 67774.

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