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

Moritz Lennert mlennert at club.worldonline.be
Thu Sep 21 05:22:54 EDT 2006


Just saw that Maciej has already responded in the same direction, but 
posting this anyway, in case it helps:

Michael Barton wrote:
> Somehow we are not communicating here.

I agree. Therefore, let me try to figure out what really is the problem 
here.

As far as I understand it, zoom-out by box never respects the form of 
the box you draw, be it within or without the region. See

http://moritz.homelinux.org/grass/grass_zooming.html

for a demonstration.

As you can see, even with no empty space on the canvas (i.e. the region 
filling the canvas completely), the shape of the region which is 
displayed after zoom-out has nothing to do with the shape of the box. 
This is completely different from the zoom-in behaviour, where the shape 
of the box is respected.

This is one issue.

The other issue, as far as I understand, is the fact that if you draw a 
zoom-in box across the empty part of the canvas (i.e. a part where 
theoretically there is map data, but the way the region is defined, this 
map data is not displayed) the resulting displayed map, includes the 
part that was not displayed before, but which was within the zooming box.

The zooming out by box does not behave this way. Obviously, after a 
zoom-out you would expect to see more of the map than what you saw 
before. This is not always the case as you can see here:

http://moritz.homelinux.org/grass/zoom_out.html

Notice the red area. It appears in the zoom-in, but it doesn't in the 
zoom-out: not very "logical"...

Maybe this helps,

Moritz


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