[GRASS-dev] Behavior of explore mode in GIS Manager
Michael Barton
michael.barton at asu.edu
Fri Aug 4 18:29:02 EDT 2006
I have a question for you all.
I just discovered an unexpected (to me) behavior of explore mode in gism. I
thought explore mode only tried to fill the display window with the rendered
map. However, it also changes the region resolution as you zoom in and out.
To give an example:
Start with the 30m DEM in Spearfish and set the region to match the DEM
Zoom in and the resolution increases to 10m, 5m, 1m
Zoom out and the resolution decreases to 60m, 90m, etc
Essentially, it is changing so that a constant number of grid cells are
represented in the display window.
I first thought this was a bug and have been trying to find where it is
located over the past day. I found it and discovered that it is intentional.
So here¹s the question.
Is this the way we want zooming to work in this special mode? If so, we need
to change the mouse over help to make sure this is clear. If not, we need to
change how explore mode works so that it does not change resolution. I can
see advantages and disadvantages of each.
I¹ve included the code of the relevant function below.
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
--- relevant function of mapcanvas.tcl with code lines marked that change
resolution.
proc MapCanvas::currentzoom { mon } {
variable zoom_attrs
variable exploremode
variable monitor_zooms
global canvas_w
global canvas_h
# Fetch the current zoom settings
set region {}
foreach attr $zoom_attrs {
lappend region $monitor_zooms($mon,1,$attr)
}
# If explore mode is engaged blow up the region to match the canvas
if {$exploremode($mon) == 1} {
# Set the region to the smallest region no smaller than the canvas
set canvas_ar [expr {1.0 * $canvas_w($mon) / $canvas_h($mon)}]
set expanded_nsew [MapCanvas::shrinkwrap 1 [lrange $region 0 3]
$canvas_ar]
puts "expanded = $expanded_nsew"
foreach {n s e w} $expanded_nsew {break}
# Calculate the resolutions
---> lappend expanded_nsew [expr {1.0 * ($n - $s) / $canvas_h($mon)}]
---> lappend expanded_nsew [expr {1.0 * ($e - $w) / $canvas_w($mon)}]
set region $expanded_nsew
}
return $region
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-dev/attachments/20060804/900a8c8a/attachment.html
More information about the grass-dev
mailing list