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

Maciej Sieczka tutey at o2.pl
Fri Sep 22 05:39:49 EDT 2006


Michael Barton wrote:

> I modeled the zoom out box after the behavior of MapInfo. After reading
> this, I went and downloaded the QGIS 8 preview release. It looks very nice.
> I checked out the zoom out box in some detail. Here is how it seems to work
> (someone from the QGIS team can clarify if I miss something).
> 
> The zoom out box simply tells QGIS to zoom out by a standard amount,
> regardless of the size and/or shape of the box. That is, the zoom out box
> does not have any effects on the display geometry or on the amount of zoom.

True, indeed.

> It does seem to pan so that the center of the zoom out box becomes the
> center of the screen. This seems in part due to how map-to-screen rendering
> works and part because of how it deals with region-of-interest.  Using the
> zoom out box and zoom out clicking in QGIS do pretty much the same thing
> AFAICT.

Correct.

> If you simply click the zoom out tool in GRASS, it works pretty much like
> QGIS does, but without centering. Previous iterations did centering too, but
> I was getting some inconsistent behavior (as you know) and dropped it when I
> redid the one-click zoom out algorithm. I probably can put it back in. But I
> guess we need to see if it is really helpful on zoom out (it certainly is on
> zoom in).

The single-click-zoom (in and out) should *re-center*. Because you are
clicking on the canvas, *pointing* a *location*. Currently only
single-click-zoom-in re-centers - but it also extends the region to fit
the whole map canvas (in error), instead of preserving the region
aspect ratio. So these 2 things should be fixed. Do we agree here?

>> OK, now I understand how it works. Questions:
>>
>> Why did you implement it this way? Other GIS software working the same?
>>
>> I checked the box-zoom-out in QGIS and UDIG - neither behaves the way
>> gis.m does. Of course, this is not an ultimate argument. But I'm
>> wondering why you decided for an IMO counter-intuitive, non-standard
>> (to my limited experience) solution?
> 
> I don't know UDIG. Many programs do not have a zoom out box, but simply do
> zooming out the way the GRASS one-click zoom out behaves.

Nice piece of software. Grab the latest stable or their RC4 (I had
problems with RC4 on Linux, but on Mac it might varry)
http://udig.refractions.net/downloads/udig-1.0.6.macosx.carbon.ppc.zip
http://udig.refractions.net/downloads/udig-1.1.RC4.macosx.carbon.x86.zip

It comes with java and required libs packaged together.

To intall on Linux I had to unpack where I liked it, make all the
contents of "/jre/java" and "/jre/javaws" as well as the "udig" in root
dir executable. To start type enter the root dir in shell an type ./udig.



Back to the point - their box-zoom-out does take the extent of the zoom
box into account, in opposite to QGIS. The smaller the box - the more
it zooms out.

>> I can explain why IMO counter-intuitive: when I draw a box (no matter
>> if zoom-out or zoom-in one) I (naturaly, I think) expect the objects
>> within this box to be in the center of display in a result. With gis.m
>> for box-zoom-out this will only happen if I over a center of the
>> canvas. If I draw the zoom box in eg. the top left corner, the
>> resulting region will be still centered on the former center, not on
>> the center of my zoom-box. Also, I don't know how to enforce the region
>> shape as I wish.
> 
> When you zoom in by drawing a box, you are in effect saying 'Make this box
> the new window on the world'. When you zoom out with a box, you are saying,
> 'Put the visible world into this box'.

That's your attitude. I in both cases mean:

1. 'Make the center of my zoom box the center of the world'

with additional:

2. for zoom-in 'and zoom INTO the zoom box preserving the aspect ratio
of my zoom box in the resulting region'

This is the way your current box-zoom-in behaves - OK.

3. for zoom-out 'and zoom OUT of the zoom box preserving the aspect
ratio of my zoom box in the resulting region'

Currently your box-zoom-out doesn't do the 1 and 3.

Comments on 1: currently, if I draw the zoom-out box in a corner, I
don't get the zoomed-out content of that area displayed in the center,
but... a zoomed-out content of my previous center, displayed in the
corner! You are saying this is OK. I find it counter-intuitive. The
level of confussion for me is similar to when I try to read a normal
writing reflected in the mirror.

Regarding 3: first please 'Zoom to a selected map'. Now - currently, if
I draw a zoom-out box wide and short, the resulting region *doesn't*
follow it's aspect ratio, but... it is tall and narrow! And vice-versa:
draw a zoom-out box tall and narrow, and your region becomes... wide
and short! Given that, how am I supposed to control the aspect ratio of
my region, when box-zooming-out?

> When you say enforcing region shape, I assume you mean that you want the
> display to extend to certain bounds in the N-S and E-W directions--probably
> for some kind of output.

Not "for some kind of output" but for any regular Grass operation that
involves region settings. Box-zoom-in in constarined mode let's me
control the center and the aspect ratio of the region. Currently
box-zoom-out in constarined mode doesn't, and it's a defect.

> Zooming in with a box lets you control interactively where the display
> bounds will be (though you may get some white space if the window geometry
> doesn't match the region geometry).

> Zooming out can never let you control the display bounds interactively, at
> least not directly in the way that a zoom-in box does.

Yes, it can't let me control the region extent directly, but it should
let me control:

a: the center of the region
a: the aspect ratio of region bounds

Currently it does neither of the the above

> The reason is that the new bounds are off the screen when you begin
to zoom
> out. QGIS doesn't let you do this either. It controls where the map
> centers, but not where the edges will be.

Yes, QGIS doesn't control where the edges will be, but eg. UDIG does.
Besides, this is not only a point how different apps do what and that
Grass should absolutely follow. Grass zooming in *constrained* mode is
primarily about setting the *region*, not about browsing maps. And,
again, the fact that currently box-zoom-out doesn't allow let me
control the region is a defect.

> In any program like this that I know of, the best way to reset more
> extensive bounds with some precision is to zoom out to a region that
> includes what you want to see. Then use a zoom-in box to interactively set
> the display bounds.
> 
> In GRASS, if you want to zoom out while preserving a height/width ratio and
> center you've already set, you can just use the zoom-out one click.

That's not the point. Indeed, I could use the box-zoom-in first to set
the aspect ratio of my region, and then use the single-click-zoom-out
to zoom out for example. I could even set my region with g.region. But
that's not the point. We are talking about fixing the box-zoom-out, not
about overcoming it's defects with other tools.

>> It took me 3 days to understand how box-zoom-out in gis.m works. Only
>> thanks to your long emails and patience. I admit my attitude was biased
>> by what I expected, but I believe other Grass users might be biased the
>> same way and get puzzled or frustrated as I did.
> 
> Various times over the past 9 months, I've been tempted to just drop the
> zoom-out box altogether.

I think we talked about it motns ago, at least in regard to
box-zoom-out. But since the tool is already present, it should work so
that people could use it.

> The one-click zoom-out is all that most programs provide. The zoom out
> box provides an additional tool for a kind of region management that
> is not found in most other programs.

I don't think that's true. At least not for QGIS, UDIG, OpenEV, FGIS,
ArcInfo 8 - those which I recall I tried.

> Many times you won't need it in GRASS either.

???

Zoom-box-in the d.zoom was always very usefull for me. The new gis.m's
box-zoom-out could be, if it worked properly.

> But I've kept it in because, in the GRASS
> tradition, it adds additional sophisticated flexibility not available
> elsewhere. Also in the GRASS tradition, it adds a layer of complexity that
> can leave people puzzled, frustrated, or both. ;-)

But why puzzle and frustrate people for no purpose? What do you gain by
impleneting the box-zoom-out in it's current form? I know what you
loose: intuitivity and the control over Grass region. This hampers
Grass learning curve, thus it's publicity, and user's productivity.

>> I believe the "normal"
>> way (eg. QGIS and UDIG) of box-zoom-out is as good as your current
>> approach in terms of browsing maps, but, which is even more important
>> for Grass GIS in the *restricted* zoom mode, the "normal" way lets the
>> user control the region shape and extent precisely.
> 
> The QGIS zoom-out box does not allow the user to control the region shape
> and extent at all, let alone precisely.

OK, so we agree here. But it could and should. Why do you hesitate?

> This is indeed the more common way these tools function. GRASS actually
> does allow the user to control the shape and and extents much more
> precisely, but in a way that might require several days of meditation
> or head banging to understand.

... and we shouldn't make it even harder by making the zoom
box-zoom-out tool working in a strange way. At least in the constrained
mode, which people will use for setting their Grass region often.

> In both the QGIS and GRASS cases, the effects of using a zoom-out tool
> is different from using a zoom-in tool.

>> Would you be willing to implement it the way I mean?
> 
> AFAICT, this is already implemented as the one-click zoom-out...except for
> recentering.

No. It is not. Single-click-zoom doesn't let you modify the region
aspect ratio while zooming out. Only the box-zoom-out does, but you
can't modify that aspect ratio in a controlable way (and also it
doens't re-center on the center of the box).

I'll quote what I wrote above:

" Indeed, I could use the box-zoom-in first to set the aspect ratio of
my region, and then use the single-click-zoom-out to zoom out for
example. I could even set my region with g.region. But that's not the
point. We are talking about fixing the box-zoom-out, not about
overcoming it's defects with other tools."

> It is possible to reimplement recenter with one-click zoom-out,
> but you lose the ability to 'back out' of a precisely defined region and
> center. Currently, you can 'back out' and then use the pan tool to recenter.

So there should be a separate zoom tool that does not involve clicking
on the map canvas. Because when I click on the canvas, I expect it to
be for a purpose - centering the view to where I click.

You could take a look at UDIG for this. Clicking on a zoom in/out icon
on the toolbar zooms and preserves the current center.
Single-click-zoom-out (right) and -in (left) zooms and recenters. The
box-zoom-in behaves the obvious way and the zoom-box-out "the way I
like it" ;D. I didn't have to read the manual, ask on mailing lists or
whatsoever. I just "figured it out" in few seconds. This is some
indicator, isn't it?

(For the record - I'm not a fan not even a user of UDIG. Actually
yesterday I made it to run it the first time in my life and I must say
I like the way the implemeneted zooming.)

> The zoom box provides an alternative way to zoom out, in addition to the
> "normal" way, that is not available with many other programs.

But it's of no use and problematic for Grass. The "normal" way is a
much better fit.

Maciek




More information about the grass-dev mailing list