Opened 16 years ago

Last modified 6 years ago

#248 new enhancement

v.info vs. r.info: different region output formats

Reported by: sebastianh Owned by: grass-dev@…
Priority: minor Milestone: 7.6.2
Component: Default Version: unspecified
Keywords: v.info, r.info, region output Cc:
CPU: All Platform: All

Description

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).

Attachments (1)

rinfo.diff (440 bytes ) - added by neteler 16 years ago.
added top/bottom of map (not region)

Download all attachments as: .zip

Change History (17)

comment:1 by neteler, 16 years ago

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

comment:2 by martinl, 16 years ago

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

comment:3 by neteler, 16 years ago

Type: defectenhancement

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

by neteler, 16 years ago

Attachment: rinfo.diff added

added top/bottom of map (not region)

comment:4 by neteler, 16 years ago

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

Markus

in reply to:  4 comment:5 by glynn, 16 years ago

Replying to 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.

in reply to:  description comment:6 by glynn, 16 years ago

Replying to 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.

comment:7 by neteler, 16 years ago

Backported to 6.4.svn (r34119).

Markus

in reply to:  2 comment:8 by hamish, 16 years ago

Replying to 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

comment:9 by martinl, 9 years ago

Milestone: 7.0.07.0.5

comment:10 by martinl, 8 years ago

Milestone: 7.0.57.3.0

comment:11 by martinl, 8 years ago

Milestone: 7.3.07.4.0

Milestone renamed

comment:12 by neteler, 7 years ago

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:13 by neteler, 6 years ago

Milestone: 7.4.17.4.2

comment:14 by martinl, 6 years ago

Milestone: 7.4.27.6.0

All enhancement tickets should be assigned to 7.6 milestone.

comment:15 by martinl, 6 years ago

Milestone: 7.6.07.6.1

Ticket retargeted after milestone closed

comment:16 by martinl, 6 years ago

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.