[GRASS-dev] ganim troubles in latest cvs

Michael Barton michael.barton at asu.edu
Mon Oct 1 00:23:40 EDT 2007


Well, after asking for help, I figured out how to this without the dread
regexp ;-). This might even be a bit better routine.

Anyway, I can't commit this because I'm out of town, but if anyone wants to
try it, you need to change lines in procedure GmAnim::main (module
animate.tcl). Replace the commented lines with the uncommented lines below.

    foreach line $reglist {
        set line [string trim $line]
        set key [lindex [split $line "="] 0]
        switch $key {
            nsres    {set oldres1 [lindex [split $line "="] 1]}
            ewres   {set oldres2 [lindex [split $line "="] 1]}
            rows    {set vrows [lindex [split $line "="] 1]}
            cols    {set vcols [lindex [split $line "="] 1]}
        }
    
    }
    
#     regexp {nsres= *([0-9]+)} $region dummy oldres1
#     regexp {ewres= *([0-9]+)} $region dummy oldres2
#     regexp {rows= *([0-9]+)} $region dummy vrows
#     regexp {cols= *([0-9]+)} $region dummy vcols
    


Michael







On 9/30/07 9:53 AM, "Glynn Clements" <glynn at gclements.plus.com> wrote:

> 
> Michael Barton wrote:
> 
>> I haven't updated in a few days but don't have a problem. Have you run
>> g.region to see what your resolution is? The res=0.0 is the problem. It is
>> getting this value from running g.region previously in your mapset,
>> returning rows, columns, and res.
> 
> GmAnim::main has:
> 
>     regexp {nsres= *([0-9]+)} $region dummy oldres1
>     regexp {ewres= *([0-9]+)} $region dummy oldres2
> 
> This isn't going to work if your resolution is less than one unit,
> e.g. lat/lon regions.
> 
> The regexp needs to allow for a decimal point.

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
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