[GRASS-dev] [GRASS GIS] #248: v.info vs. r.info: different region output formats

#248: v.info vs. r.info: different region output formats
-------------------------------------------+--------------------------------
Reporter: sebastianh | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: minor | Milestone: 7.0.0
Component: default | Version: unspecified
Keywords: v.info, r.info, region output | Platform: All
      Cpu: All |
-------------------------------------------+--------------------------------
In a location with a geographic crs, the region outputs (esp. the unit
formats) of vector and raster layers differs from each other.
v.info prints the region in decimal degrees (DD) whereas r.info produces
an output in degrees,minutes,seconds (DMS).

For example (nc_ll location from www.grassbooks.org):
{{{
  > v.info -g precip_30ynormals
  north=36.49917
  south=33.99472
  east=-75.62194
  west=-84.02389
  top=1615.440000
  bottom=2.438400

  > r.info -g elev_ned_03arcsec
  north=35:54:40.666666N
  south=35:35:17.334885N
  east=78:27:08.335106W
  west=78:49:17.333333W
}}}
For parsing both ouputs with external tools, it would be better if the
formats were equal (preferably decimal degrees).

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

#248: v.info vs. r.info: different region output formats
-------------------------+--------------------------------------------------
  Reporter: sebastianh | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: minor | Milestone: 7.0.0
Component: default | Version: unspecified
Resolution: | Keywords: v.info, r.info, region output
  Platform: All | Cpu: All
-------------------------+--------------------------------------------------
Comment (by neteler):

I have added top/bottom support (patch attached) but it seems to work only
in not-latlong locations:

{{{r.info -g elev_ned_03arcsec
north=35:54:40.666666N
south=35:35:17.334885N
east=78:27:08.335106W
west=78:49:17.333333W
top=1E
bottom=0
}}}

Apparently there is some extra magic in g.region -p3.

Markus

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

#248: v.info vs. r.info: different region output formats
-------------------------+--------------------------------------------------
  Reporter: sebastianh | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: minor | Milestone: 7.0.0
Component: default | Version: unspecified
Resolution: | Keywords: v.info, r.info, region output
  Platform: All | Cpu: All
-------------------------+--------------------------------------------------
Comment (by martinl):

BTW in GRASS7 I would like to add shell script style output for r/v.info.
To follow standard flag naming, this flag should '-g' which is now
reserved for "Print map region only" (which could be renamed to '-r'.) ?

Martin

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

#248: v.info vs. r.info: different region output formats
--------------------------+-------------------------------------------------
  Reporter: sebastianh | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: minor | Milestone: 7.0.0
Component: default | Version: unspecified
Resolution: | Keywords: v.info, r.info, region output
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Changes (by neteler):

  * type: defect => enhancement

Comment:

Corrected patch attached:

{{{
r.info -g elev_ned_03arcsec
north=35:54:40.666666N
south=35:35:17.334885N
east=78:27:08.335106W
west=78:49:17.333333W
top=170.099487
bottom=20.991688
}}}

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

#248: v.info vs. r.info: different region output formats
--------------------------+-------------------------------------------------
  Reporter: sebastianh | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: minor | Milestone: 7.0.0
Component: default | Version: unspecified
Resolution: | Keywords: v.info, r.info, region output
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by neteler):

Submitted to 6.4.svn (r34114) and 7.svn (r34113).

Markus

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

#248: v.info vs. r.info: different region output formats
--------------------------+-------------------------------------------------
  Reporter: sebastianh | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: minor | Milestone: 7.0.0
Component: default | Version: unspecified
Resolution: | Keywords: v.info, r.info, region output
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by glynn):

Replying to [comment:4 neteler]:
> Submitted to 6.4.svn (r34114) and 7.svn (r34113).

This is bogus. zmin and zmax are the range of the data (which isn't
necessarily elevation). This information is added to the output by the -r
flag.

"top" and "bottom" are only meaningful for 3d rasters; note that "r3.info
-g" '''does''' output top= and bottom=.

Changes reverted.

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

#248: v.info vs. r.info: different region output formats
--------------------------+-------------------------------------------------
  Reporter: sebastianh | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: minor | Milestone: 7.0.0
Component: default | Version: unspecified
Resolution: | Keywords: v.info, r.info, region output
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by glynn):

Replying to [ticket:248 sebastianh]:
> In a location with a geographic crs, the region outputs (esp. the unit
formats) of vector and raster layers differs from each other.
> v.info prints the region in decimal degrees (DD) whereas r.info produces
an output in degrees,minutes,seconds (DMS).

> For parsing both ouputs with external tools, it would be better if the
formats were equal (preferably decimal degrees).

Done (also for !r3.info). In r34118, -g now always outputs in decimal.

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

#248: v.info vs. r.info: different region output formats
--------------------------+-------------------------------------------------
  Reporter: sebastianh | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: minor | Milestone: 7.0.0
Component: default | Version: unspecified
Resolution: | Keywords: v.info, r.info, region output
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by neteler):

Backported to 6.4.svn (r34119).

Markus

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

#248: v.info vs. r.info: different region output formats
--------------------------+-------------------------------------------------
  Reporter: sebastianh | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: minor | Milestone: 7.0.0
Component: default | Version: unspecified
Resolution: | Keywords: v.info, r.info, region output
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by hamish):

Replying to [comment:2 martinl]:
> BTW in GRASS7 I would like to add shell script style output for
> r/v.info.

? don't we already have that in GRASS 6.x from lots of flags?

> To follow standard flag naming, this flag should '-g' which is
> now reserved for "Print map region only" (which could be
> renamed to '-r'.) ?

-g is used across modules more generally to mean "output in shell script
style"; albeit usually (but not always) to do with region bounds. (eg
r.univar)

As '-r' works quite nicely for "range" (IMO) I don't see the need for a
change. As long as we are consistent it is quickly learned.

2c,
Hamish

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