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

Michael Barton michael.barton at asu.edu
Wed Sep 20 13:30:58 EDT 2006


> From: Maciej Sieczka <tutey at o2.pl>
> Date: Wed, 20 Sep 2006 18:24:58 +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
> 
>> 
>> The box zoom-in and zoom-out CANNOT operate the same mathematically, as I
>> tried to explain below. It is impossible. Given that, the question is what
>> kind of result do you want to see. Currently, both update the region in both
>> dimensions exactly as defined by the zoom box.
> 
> That's not true. Box-zoom-in indeed always updates the region geometry
> exactly following the zoom box (OK), but the box-zoom-out fails to do
> that *if* the zoom box overlaps the part of map canvas where nothing is
> rendered (BAD).

Zooming in decreases the region extents while zooming out increases the
extents.

You are not following the math. A zoom in box uses the geographic
coordinates of the box extents to directly set the new region extents. This
is IMPOSSIBLE to do with a zoom out box. Rather the box defines a region,
and new larger extents must be calculated such that the original extents fit
inside the region defined by the zoom out box. To zoom out, you must make
the region bigger than what you can see. You cannot draw a box on the screen
that is bigger than the screen (or at least I don't think that anyone would
want to do this). So the box cannot directly define the extents.


> 
>> You suggest that it gives visually undesirable results. Updating the region
>> "properly" is meaningless> (sorry). This depends on what is meant by
>> "properly".
> 
> "properly" means that the box-zoom update the region geometry according
> to the geometry of the zoom box. Currently this is only the case for
> box-zoom-in - no matter if the zoom box overlaps the part of map canvas
> where nothing is rendered or not. In case of box-zoom-out however, if
> the zoom box overlaps the part of map canvas where nothing is rendered,
> the resulting region geometry fails to reflect the geomtery of the zoom
> box, which is "wrong".
> 

Currently the new region defined by a zoom out box DOES reflect the geometry
of the zoom box. This is why it looks weird to you. You are giving it weird
geometry. You are essentially telling it to increase the region extents so
that the current region gets smaller. It almost sounds like you are saying
that if you try to zoom "out" to an area smaller than your box the result
should be to zoom "in", that is a tool designed to INCREASE region extents
should REDUCE the region extents in these circumstances. This seems like a
completely unexpected behavior of a tool that is supposed to INCREASE the
region extents. 

It would help to know if you are actually trying to achieve some kind of
meaningful result and what that is, or if you are just trying out tools in
various circumstances.

I'm have set the zoom out box tool to treat the case of a zoom out box
larger than the current region as undefined, so that it does not change the
display region in that dimension (it won't produce an error). This will
probably give you the visual effects you are looking for, but I'm not sure.



Michael

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics and 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