[GRASS-dev] Re: gis.m zooming: 2 new bugs

Michael Barton michael.barton at asu.edu
Thu Sep 21 03:57:19 EDT 2006


Somehow we are not communicating here.


> From: Maciej Sieczka <tutey at o2.pl>
> Date: Thu, 21 Sep 2006 07:44:04 +0200
> To: Michael Barton <michael.barton at asu.edu>
> Cc: Michael Barton <c.michael.barton at gmail.com>, grass-dev
> <grass-dev at grass.itc.it>, Moritz Lennert <mlennert at club.worldonline.be>
> Subject: Re: [GRASS-dev] Re: gis.m zooming: 2 new bugs
> 
> No. The E-W extent should change the same way the N-S does. This is the
> case now for box-zoom-out (GOOD), but only when the zoom box doesn't
> overlap the map canvas outside the current region (BAD).
> This should be
> fixed - so that the region geometry reflects the zoom box geometry
> exactly, no matter if the zoom box overlaps the map canvas outside the
> current region or not. Box-zoom-in behaves correctly in this regard.
> Box-zoom-out should do the same.

Let me try again. Zooming in makes a map (total extents) smaller. Then the
graphic image of the map must be expanded to fill the display window. The
map *looks* magnified, even though it is smaller than before.

Zooming out makes a map bigger (total extents). Then the graphic image must
be shrunk to fit into the display window. Hence the map *looks* reduced,
even though it is bigger than before. One must be careful not to confuse the
region geometry (NSEW extents) with the part the region that holds a visible
raster or vector or the apparent size and shape of the visible portion of a
region within the display window.

Zoom in and zoom out boxes work completely differently from each other. The
zoom in box makes the new region the size and shape of the box. The zoom out
box defines a region that the original extents must fit into and expands the
region in order to make this happen.

At the time of your first report a couple days ago, the zoom out box worked
exactly the same in all directions, regardless of whether it was larger than
the region or not. 

Extending a zoom out box beyond the bounds of the current region
conceptually doesn't make sense (like asking, How large is blue?). The
region already fits inside the box, so it makes no sense to expand the
region so that the original extents fit inside the box. In this case, the
zoom out algorithm, working perfectly correctly and consistently in all
directions, can produce visual results that are not very useful.

For changing the region, using a zoom out box that extends beyond the region
bounds, the only meaningful computational alternatives are the following:

1. let inappropriate use of a zoom out box continue to produce logically
consistent and completely predictable, but not very useful results on the
display;

2. generate an error dialog when someone tries to draw zoom out box that
extends beyond a region boundary;

3. change the zoom out box behavior when it is drawn beyond a region
boundary (i.e., a region extent is already inside the box) so that it no
longer behaves like a zoom out box but sets the region in a different way. I
see 2 reasonable ways to change the behavior of a zoom out box when it goes
out of bounds.

3a. Where the zoom out box extends beyond the region bounds, it simply does
not do anything. That is, it does not change the region. The part of the
zoom out box that remains within the region bounds will change the region
accordingly (i.e., expand it so that the original extents will fit into the
box) and the other extents will simply stay the way they were. This is
pretty straightforward behavior conceptually and not overly difficult to
describe. The new region does fit inside the box, but may not fill it in all
directions. This is the way it is now.

3b. Where the zoom out box extends beyond the region bounds, it changes to
behave like a zoom in box. That is, the box itself defines the new region
extents in the out of bounds part and the region expands to completely fill
the box in that dimension. Where it remains within the region bounds it
still behaves like a zoom out box (i.e., expand the region in that dimension
so that the original extents will fit into the box). This is conceptually
more complicated and harder to explain from scratch, but perhaps more
satisfying to some in that the region fills the box in all directions,
regardless of how it started out. This produces visual effects similar to,
but not exactly the same as 3a.

There are no other options AFAICT. It is not a matter of being unwilling to
make changes. It's just that these are all the possible algorithms that
produce reasonably meaningful region changing behavior with a zoom out box.
However, if someone can come up with a different algorithm, more power to
them.

Michael



__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton 




More information about the grass-dev mailing list