[GRASS-user] vector works in X0 monitor but not in gis.m

Daniel Victoria daniel.victoria at gmail.com
Wed Dec 26 13:09:32 EST 2007


I while ago I had a problem with tcl map canvas and polyconic
projection. Glynn noted it was a quoting problem in the GUI and sent
some code to the list (email copied bellow) but I had no idea what to
do with it. Well, I forgot about the problem because I was working
using the xmon but today, when I tried to display a vector map with
the polyconic projection, I got the same error.

I using grass version 6.2.3 from http://les-ejk.cz/ubuntu repository.
I have ubuntu gutsy Gibon installed

Cheers and happy holidays
Daniel

On Mar 24, 2007 2:53 PM,
>
> > > I imported an arc coverage into a polyconic projection and I'm able to
> > > see the vectors when using the X0 monitor (d.vect command) but, when I
> > > try to use the gis.m canvas, the following error appears in the Output
> > > GIS.m screen
> > >
> > > ---------------------------------------------------------------------
> > > region for current mapset line 1: <projection:99 (Polyconic > run "g.region"
> > > ---------------------------------------------------------------------
> > >
> > > And nothing gets drawn. Funny is that I can query the canvas with the
> > > mouse and see the vector attributes, meaning that the monitor extent
> > > is correct.
> > >
> > > g.region -p output is:
> > >
> > > projection: 99 (Polyconic (American))
> > ..
> > > BTW, using grass 6.2.1 from Debian repos
> >
> >
> > Looks like a quoting bug in the GUI. (gets cut at second "(")
>
> Probably related to this in mapcanvas.tcl:
>
>                 # Finally put this into wind file format to use with GRASS_REGION
>                 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.
>
> --
> Glynn Clements <glynn at gclements.plus.com>
>


More information about the grass-user mailing list