[GRASS-dev] Re: [GRASS-user] check vector geometry

Martin Landa landa.martin at gmail.com
Mon Sep 25 15:39:39 EDT 2006


Hi Glynn,

well, trying to follow your suggestion, see [1] and the patch.

Best, Martin

[1] http://gama.fsv.cvut.cz/~landa/.../grass/g_region_log2.txt

2006/9/25, Glynn Clements <glynn at gclements.plus.com>:
>
> Maciej Sieczka wrote:
>
> > >> The region extent is printed, like if -e alone was used, but instead of
> > >> "region north-south extent" we get "ns_extent". Same thing, but
> > >> different wording.
> >
> > > That makes sense. The -e flag displays the extents, while -g selects a
> > > machine-readable format. Using both should display the extents in a
> > > machine-readable format.
> >
> > Indeed it makes much sense, I get it. Hmm, but then -gc, -gl should
> > also output in a machine-readable format - but they don't, they still
> > print like if -c, -l was used alone.
> >
> > Moreover, g.region description says: "-g Print the current region
> > (shell script style)". It doesn't mention the fact it can be combined
> > with other flags to make them print in shell script style - it only
> > mentions the region.
> >
> > Given these, how should g.region be fixed then?
>
> I suggest:
>
> 1. Make -g, -l and -m orthogonal to other options, i.e. any option
> which displays some information should take account of these options.
>
> 2. Make -p, -e and -c orthogonal rather than mutually exclusive, i.e.
> any combination of those three flags should be allowed, with multiple
> flags resulting in multiple pieces of information being displayed.
>
> 3. If either -g or -l (or both) are given, and none of -p, -e or -c
> are given, assume -p.
>
> > I suppose that -g alone should not work at all. Only when combined with
> > -p,-e,-c,-l it should print their machine-readable version. That would
> > make things clear and consistent. Of course not a plan for Grass 6.
> > Grass 7?
>
> See #3 above. This can be implemented now, as all of the "intended"
> combinations of flags will still produce the same output. Only the
> behaviour for unintended combinations will change.
>
> > > Note that -g is essentially shorthand for -pg; any option which
> > > selects an output format implies -p unless some other option is given.
> >
> > That's good to know, but it is not the way it is explained in Description.
>
> I suspect that the behaviour is accidental rather than by design. -g
> chooses a specific mode, but the code which handles -e also checks the
> state of -g. IOW, it's both a mode and a modifier.
>
> --
> Glynn Clements <glynn at gclements.plus.com>
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass-dev
>


-- 
Martin Landa <landa.martin at gmail.com> * http://gama.fsv.cvut.cz/~landa *
-------------- next part --------------
A non-text attachment was scrubbed...
Name: g_region_pg2.diff.gz
Type: application/x-gzip
Size: 5725 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20060925/11e56bf9/g_region_pg2.diff.gz


More information about the grass-user mailing list