[GRASS-dev] [GRASS GIS] #2455: r.unpack/v.unpack: add sanity check for auto-detecting if pack file contains raster or vector data

#2455: r.unpack/v.unpack: add sanity check for auto-detecting if pack file
contains raster or vector data
--------------------------------+-------------------------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Raster | Version: svn-releasebranch70
Keywords: r.unpack, v.unpack | Platform: All
      Cpu: Unspecified |
--------------------------------+-------------------------------------------
Small issue for GRASS data transfer via "pack" format:

In case that a user doesn't use a self-explaining file name, it may not be
obvious if r.unpack or v.unpack has to be used. In case of running the
wrong command, an "ugly" error message appears rather than telling the
user to apply the other respective unpack command.

Solution: simply check for the presence of 'mapname/cell' or
'mapname/coor' and generate a user message if the wrong content was
detected.

Message suggestions:

{{{
#r.unpack

grass.fatal(_("This GRASS GIS pack file contains vector data. Use v.unpack
to unpack <%s>) % map_name))

#v.unpack

grass.fatal(_("This GRASS GIS pack file contains raster data. Use r.unpack
to unpack <%s>) % map_name))
}}}

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

#2455: r.unpack/v.unpack: add sanity check for auto-detecting if pack file
contains raster or vector data
----------------------+-----------------------------------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Raster | Version: svn-releasebranch70
Resolution: fixed | Keywords: r.unpack, v.unpack
  Platform: All | Cpu: Unspecified
----------------------+-----------------------------------------------------
Changes (by lucadelu):

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

Comment:

Fixed in r62310 and backported to GRASS 7 r62311

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