[GRASS-dev] Re: vector works in X0 monitor but not in gis.m (Daniel Victoria)

Michael Barton michael.barton at asu.edu
Thu Dec 27 15:47:12 EST 2007

I've committed the fix below suggested by Glynn. I tested it on the  
new NC demo data set and it causes no problems.

Of course, the old regexp statement worked too in my tests. Since I'm  
so abysmal at regexp, I just have to go with this, like I did with  
the old statement (someone else suggested it to fix an earlier  
problem with latlon regions).

Could someone please test this since I'm not completely clear what  
breaks the old algorithm that works with this one? Hopefully this  
will work with all projections this time.

C. 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-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>

On Dec 27, 2007, at 6:38 AM, grass-user-request at lists.osgeo.org wrote:

>> Probably related to this in mapcanvas.tcl:
>>                 # Finally put this into wind file format to use  
>>                 regexp -nocase {^.* (\(.*\))} $parts(projection)  
>> trash end
>>                 set parts(projection) [string trim $parts 
>> (projection) $end]
>> The "*" operator will try to match as much as possble, so matching  
>> the
>> string "99 (Polyconic (American))" against the regexp"^.* (\(.*\))"
>> will result in the ".*" matching ""99 (Polyconic " and the "(\(.*\))"
>> matching "(American))", so "end" will be set to "American)"
>> Also, using "string trim" here is bogus; it discards any leading or
>> trailing section consisting of characters in the specified string,
>> which may be more than just the string itself (if $end contains the
>> digit 9, it will strip the projection code).
>> It should probably just match the portion that it wants, e.g.:
>>         regexp -nocase {^([0-9]+)} $parts(projection) trash parts 
>> (projection)
>> rather than trying to match and discard the portion that it doesn't
>> want.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-dev/attachments/20071227/2ef2c97a/attachment.html

More information about the grass-dev mailing list