<HTML>
<HEAD>
<TITLE>Re: [GRASS-user] Region definition in Grass 6.1 (and 6.1 cvs)</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'><BR>
__________________________________________<BR>
Michael Barton, Professor of Anthropology<BR>
School of Human Evolution &amp; Social Change &nbsp;&nbsp;&nbsp;<BR>
Center for Social Dynamics &amp; Complexity<BR>
Arizona State University<BR>
<BR>
phone: 480-965-6213<BR>
fax: 480-965-7671<BR>
www: <a href="http://www.public.asu.edu/~cmbarton">http://www.public.asu.edu/~cmbarton</a> <BR>
<BR>
<BR>
<BR>
<BR>
<FONT COLOR="#0000FF">&gt; From: David Finlayson &lt;david.p.finlayson@gmail.com&gt;<BR>
&gt; Date: Sun, 20 Aug 2006 23:56:00 -0700<BR>
&gt; To: Glynn Clements &lt;glynn@gclements.plus.com&gt;<BR>
&gt; Cc: Michael Barton &lt;michael.barton@asu.edu&gt;, &lt;grassuser@grass.itc.it&gt;<BR>
&gt; Subject: Re: [GRASS-user] Region definition in Grass 6.1 (and 6.1 cvs)<BR>
&gt; <BR>
&gt; Region definition and modification is a critical feature of a GIS (probably <BR>
&gt; THE distinguishing feature of a GIS over a drawing program). However it is <BR>
&gt; done, it should be simple to understand and there should be no surprises. I <BR>
&gt; favor an option panel that explicitly controls how regions are modified and <BR>
&gt; controlled during zooming and panning. Three obvious behaviors are: <BR>
&gt; <BR>
&gt; - region defined manually (nothing ever ever changes this no matter what is <BR>
&gt; displayed on the screen)<BR>
<BR>
</FONT>Do you mean the region for non-display commands? In order to put an image into a canvas, you need to set the region (or at least a temporary/dynamic region) and render the map to an image file that can be displayed in the canvas. If you zoom in or out, you must reset this region and re-render the map to a new image file for display. So this probably means changing the region for display does not affect the region settings used by other, non-display modules.<BR>
<BR>
This is what happens now if you start/run any module from the command line<BR>
<FONT COLOR="#0000FF"><BR>
&gt; - region matches display (cut region at nearest cell boundary)<BR>
<BR>
</FONT>Region for non-display modules matches the region set for rendering a map to the current display. This is pretty much how things work in normal mode if run from the GIS Manager menus.<BR>
<FONT COLOR="#0000FF"><BR>
&gt; - region matches display, dynamically redefine resolution to match set number <BR>
&gt; of rows and columns <BR>
<BR>
</FONT>This is what happens in &#8216;explore mode&#8217;--i.e., when the fill display with map button is toggled.<BR>
<FONT COLOR="#0000FF"><BR>
&gt; <BR>
&gt; There should be a check box that decides how the map display/region will be <BR>
&gt; linked. I like the option of unlinking them entirely (see first option above) <BR>
&gt; since for very large maps it is impossible to view them on a monitor in full <BR>
&gt; resolution. We wind up with exported images that downsample the data and other <BR>
&gt; weird behavior. <BR>
&gt; <BR>
&gt; We should keep in mind that for survey purposes this feature is extremely <BR>
&gt; important. Introducing a half cell shift in the data set can introduce error <BR>
&gt; propagation problems that can render a higher-order survey unacceptable. It <BR>
&gt; also leads to undesirable aliasing artifacts when the new resolution doesn't <BR>
&gt; match the old in a sensible manner. <BR>
&gt; <BR>
&gt; <BR>
&gt; On 8/18/06, Glynn Clements &lt;glynn@gclements.plus.com&gt; wrote:<BR>
</FONT><FONT COLOR="#008000">&gt;&gt; <BR>
&gt;&gt; Michael Barton wrote:<BR>
&gt;&gt; <BR>
</FONT><FONT COLOR="#800080">&gt;&gt;&gt;&gt;&gt; but most important: If you zoom in and make some action (for example<BR>
&gt;&gt;&gt;&gt;&gt; r.to.vect) it will affect ONLY on zoomed fragment<BR>
</FONT><FONT COLOR="#FF0000">&gt;&gt;&gt; <BR>
&gt;&gt;&gt; IMPORTANT CLARIFICATION: Region zooming in the display generally ONLY <BR>
&gt;&gt;&gt; affects that display and related tools IN THAT DISPLAY. Most system wide<BR>
&gt;&gt;&gt; commands (e.g., r.to.vect) will respond to the current setting in the WIND<BR>
&gt;&gt;&gt; file, not the dynamic region setting in the display. This is because we are <BR>
&gt;&gt;&gt; trying to avoid having any particular display affect the system-wide WIND<BR>
&gt;&gt;&gt; file.<BR>
&gt;&gt;&gt; <BR>
&gt;&gt;&gt; So if you are running a system-wide command (i.e., not tied to a display,<BR>
&gt;&gt;&gt; its toolbar, or its layer tree) you need to make any desired region settings <BR>
&gt;&gt;&gt; via g.region. It doesn't matter whether g.region is run from the command<BR>
&gt;&gt;&gt; line or from a menu selection. Alternatively, you can display the region you<BR>
&gt;&gt;&gt; want, then select 'set WIND file from displayed region' from the menu button <BR>
&gt;&gt;&gt; on the display toolbar. If you just zoom interactively to somewhere in the<BR>
&gt;&gt;&gt; display without setting the WIND file, the region-related effects of a<BR>
&gt;&gt;&gt; system-wide command may not be what you want.<BR>
&gt;&gt;&gt; <BR>
&gt;&gt;&gt; We may want to think about this more. Would it be better for a system-wide<BR>
&gt;&gt;&gt; command to affect the region set by g.region or the region displayed in a<BR>
&gt;&gt;&gt; particular display? Which display? How to make sure it is what you &nbsp;want? <BR>
</FONT><FONT COLOR="#008000">&gt;&gt; <BR>
&gt;&gt; The display region certainly shouldn't be stored in the WIND file<BR>
&gt;&gt; (unless the user specifically selects that option). Whether or not the<BR>
&gt;&gt; display region should affect commands run from gis.m is a separate<BR>
&gt;&gt; issue.<BR>
&gt;&gt; <BR>
&gt;&gt; Personally, I would say yes. At least, it definitely needs to be<BR>
&gt;&gt; possible to run a command from gis.m using a region other than that<BR>
&gt;&gt; stored in the WIND file. IMHO, the WIND file should be considered a<BR>
&gt;&gt; &quot;legacy&quot; feature, i.e. retained solely for the purpose of backward<BR>
&gt;&gt; compatibility.<BR>
&gt;&gt; <BR>
&gt;&gt; gis.m should either use the region of the &quot;active&quot; display, or have<BR>
&gt;&gt; its own concept of &quot;current region&quot; distinct from the WIND file. <BR>
&gt;&gt; AFAICT, the main issue with the former is choosing a useful notion of<BR>
&gt;&gt; an &quot;active&quot; display.<BR>
&gt;&gt; <BR>
&gt;&gt; If each display window had its own copy of the menu bar, this would be<BR>
&gt;&gt; simple; the active display for any command run from the menus would be <BR>
&gt;&gt; the display to which the menu bar was attached.<BR>
&gt;&gt; <BR>
&gt;&gt; With a single menu bar, you would need some other way to select the<BR>
&gt;&gt; active display. Using the WM focus isn't sensible, IMHO; depending<BR>
&gt;&gt; upon the WM, switching from a display window to the window containing <BR>
&gt;&gt; the menu bar using e.g. Alt-Tab may result in a different display<BR>
&gt;&gt; window temporarily obtaining the focus.<BR>
&gt;&gt; <BR>
&gt;&gt; OTOH, if you don't use the region from an active display, but have a<BR>
&gt;&gt; distinct &quot;current region&quot;, there should be an option to indicate this <BR>
&gt;&gt; on the display(s), so that the user isn't surprised when a<BR>
&gt;&gt; newly-created map has different bounds and/or resoltion to the map<BR>
&gt;&gt; they were just looking at.<BR>
&gt;&gt; <BR>
&gt;&gt; --<BR>
&gt;&gt; Glynn Clements &lt; glynn@gclements.plus.com <a href="mailto:glynn@gclements.plus.com">&lt;mailto:glynn@gclements.plus.com&gt;</a> &gt;<BR>
&gt;&gt; <BR>
&gt;&gt; _______________________________________________<BR>
&gt;&gt; grassuser mailing list<BR>
&gt;&gt; grassuser@grass.itc.it<BR>
&gt;&gt; <a href="http://grass.itc.it/mailman/listinfo/grassuser">http://grass.itc.it/mailman/listinfo/grassuser</a><BR>
</FONT><FONT COLOR="#0000FF">&gt; <BR>
&gt; <BR>
&gt; <BR>
&gt; -- <BR>
&gt; David Finlayson<BR>
</FONT></SPAN></FONT>
</BODY>
</HTML>