[GRASS-dev] Zooming issue in gis manager

Glynn Clements glynn at gclements.plus.com
Thu Nov 2 19:44:49 EST 2006

Hamish wrote:

> > At magnifications significantly above unity, this is likely to be
> > problematic for interactive zooming. You either have to adjust the
> > bounds so that they aligh with the existing cell grid, or adjust the
> > resolution so that the cell grid aligns with the bounds.
> Surely adjusting the region bounds to match the data is better than
> adjusting the data (visually) to fit in the region bounds.
> The data is sacrosanct. The region bounds are a temporary whim.

It's not an issue of adjusting the "data" versus the bounds. It's an
issue of adjusting the resolution versus the bounds.

Which one should be adjusted depends upon which one is known to be
correct and which one is an arbitrary figure pulled out of thin air.

FWIW, G_adjust_Cell_head() (and thus everything which uses it, e.g. 
G_get_window() etc) always adjusts the resolution rather than the
bounds. If you want the bounds to be adjusted in order to preserve the
resolution, you have to do it yourself.

> As long as the gui window's x,y cursor output etc keeps up to date with
> any adjustments, it doesn't seem very problematic to me to slightly
> nudge the zoom box to fit the data's resolution before rendering.

If you want to preserve the resolution, then you need to adjust the
bounds yourself. Not just when exporting to the WIND file, but also in
the region passed to d.rast etc.

If the region passed to a GRASS module (via WIND, $WIND_OVERRIDE or
$GRASS_REGION) doesn't satisfy the requirements that (east-west)/ewres
and (north-south)/nsres are integers, libgis will modify ewres and
nsres accordingly.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list