[GRASS-user] vector works in X0 monitor but not in gis.m
Glynn Clements
glynn at gclements.plus.com
Sat Mar 24 12:53:37 EDT 2007
Hamish wrote:
> > 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