landam / grass-gis-git-migration-test

0 stars 0 forks source link

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

Open landam opened 5 years ago

landam commented 5 years ago

Reported by sebastianh on 2 Aug 2008 07:56 UTC 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).

Migrated-From: https://trac.osgeo.org/grass/ticket/248

landam commented 5 years ago

Attachment from neteler on 30 Oct 2008 20:17 UTC added top/bottom of map (not region) https://trac.osgeo.org/grass/attachment/ticket/248/rinfo.diff

landam commented 5 years ago

Comment by neteler on 2 Aug 2008 12:02 UTC I have added top/bottom support (patch attached) but it seems to work only in not-latlong locations:

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

landam commented 5 years ago

Comment by @landam on 2 Aug 2008 19:13 UTC 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

landam commented 5 years ago

Comment by neteler on 30 Oct 2008 20:17 UTC 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
landam commented 5 years ago

Comment by neteler on 30 Oct 2008 20:40 UTC Submitted to 6.4.svn (https://trac.osgeo.org/grass/changeset/34114) and 7.svn (https://trac.osgeo.org/grass/changeset/34113).

Markus

landam commented 5 years ago

Comment by glynn on 30 Oct 2008 22:09 UTC Replying to [comment:4 neteler]:

Submitted to 6.4.svn (https://trac.osgeo.org/grass/changeset/34114) and 7.svn (https://trac.osgeo.org/grass/changeset/34113).

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 "https://trac.osgeo.org/grass/changeset/3.info -g" '''does''' output top= and bottom=.

Changes reverted.

landam commented 5 years ago

Comment by glynn on 30 Oct 2008 22:36 UTC 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 !https://trac.osgeo.org/grass/changeset/3.info). In https://trac.osgeo.org/grass/changeset/34118, -g now always outputs in decimal.

landam commented 5 years ago

Comment by neteler on 30 Oct 2008 23:50 UTC Backported to 6.4.svn (https://trac.osgeo.org/grass/changeset/34119).

Markus

landam commented 5 years ago

Comment by hamish on 2 Nov 2008 07:36 UTC 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

landam commented 5 years ago

Modified by @landam on 12 May 2016 06:44 UTC

landam commented 5 years ago

Modified by @landam on 25 Aug 2016 15:51 UTC

landam commented 5 years ago

Comment by @landam on 27 Aug 2016 13:42 UTC Milestone renamed

landam commented 5 years ago

Comment by neteler on 26 Jan 2018 11:40 UTC Ticket retargeted after milestone closed

landam commented 5 years ago

Modified by neteler on 12 Jun 2018 20:48 UTC

landam commented 5 years ago

Comment by @landam on 25 Sep 2018 16:53 UTC All enhancement tickets should be assigned to 7.6 milestone.

landam commented 5 years ago

Comment by @landam on 25 Jan 2019 21:08 UTC Ticket retargeted after milestone closed