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

GRASS GIS trac at osgeo.org
Wed Dec 2 12:52:13 PST 2015


#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>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list