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

Hi all,

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))
zone: 0
datum: sam69
ellipsoid: sam69
north: 0
south: -1522812.5
west: 0
east: 931875.9375
nsres: 0.99999967
ewres: 0.99999993
rows: 1522813
cols: 931876
cells: 1419072887188

BTW, using grass 6.2.1 from Debian repos

Thanks
Daniel

Daniel Victoria 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 "(")

Hamish

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@gclements.plus.com>

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@gclements.plus.com>