[GRASS-dev] [GRASS GIS] #488: v.db.addcol/v.rast.stats not working

#488: v.db.addcol/v.rast.stats not working
--------------------------------------+-------------------------------------
Reporter: hellik | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Keywords: v.db.addcol v.rast.stats | Platform: MSWindows Vista
      Cpu: Unspecified |
--------------------------------------+-------------------------------------
osgeo4w (2008/02/08):
     grass64rc3-2
         GDAL 1.5.4, released 2009/01/07

data:
     gisdemo_ncspm

         g.gisenv --v
                 GISDBASE='C:\gisdata\grassdata';
                 LOCATION_NAME='gisdemo_ncspm';
                 MAPSET='user1';
                 GRASS_GUI='wxpython';
                 "DEBUG='3"';

         r.random -d input=elevation@PERMANENT n=100 vector_output=vrand

         v.buffer --verbose input=vrand@user1 output=vrandb distance=10
minordistance=10
         v.category input=vrandb@user1 output=vrandb2@user1

         db.tables -p
                 streetstest
                 vrand

=> no table for vector vrandb2
=> create table for vector via "Attribute table manager-Manage Layer -
Create table":
         Table Description: Table name => vrandb, Key colomn => cat

         db.tables -p
                 streetstest
                 vrand
                 vrandb2

=> add layer and set to default via "Attribute table manager-Manage Layer
- Add layer"

         v.info map=vrandb2@user1
+----------------------------------------------------------------------------+
  | Layer: vrandb2@user1
|
  | Mapset: user1
|
  | Location: gisdemo_ncspm
|
  | Database: C:\gisdata\grassdata
|
  | Title:
|
  | Map scale: 1:1
|
  | Map format: native
|
  | Name of creator: syringia
|
  | Organization:
|
  | Source date: Mon Feb 09 18:08:02 2009
|
|----------------------------------------------------------------------------|
  | Type of Map: vector (level: 2)
|
  |
|
  | Number of points: 0 Number of areas: 100
|
  | Number of lines: 0 Number of islands: 100
|
  | Number of boundaries: 100 Number of faces: 0
|
  | Number of centroids: 100 Number of kernels: 0
|
  |
|
  | Map is 3D: No
|
  | Number of dblinks: 1
|<=
  |
|
  | Projection: Lambert Conformal Conic
|
  | N: 228129.97668769 S: 215100.02331231
|
  | E: 644720 W: 630530.09314054
|
  |
|
  | Digitization threshold: 0
|
  | Comments:
|
  |
|
+----------------------------------------------------------------------------+

=> table/layer linked

=> check table/coloumns in vrandb2-table

         db.columns table=vrandb2
                 cat

         db.describe -c table=vrandb2
                 ncols: 1
                 nrows: 100
                 Column 1: cat:INTEGER:11

         v.info -c map=vrandb2@user1
                 Displaying column types/names for database connection of
                 layer 1:
                 INTEGER|cat

=> example from the manual: v.db.addcol sentiero_brenta_points
columns="slope double precision"
=> add new coloumn in vrandb2-table:

         v.db.addcol map=vrandb2@user1 columns="barea double precision"

                 C:/OSGeo4W/apps/grass/grass-6.4.0RC3/scripts/v.db.addcol:
                 eval: line 1: unexpected EOF while looking for matching
`''
                 C:/OSGeo4W/apps/grass/grass-6.4.0RC3/scripts/v.db.addcol:
                 eval: line 2: syntax error: unexpected end of file
                 C:/OSGeo4W/apps/grass/grass-6.4.0RC3/scripts/v.db.addcol:
                 GISDBASE: parameter null or not set

=> no column added

         v.info -c map=vrandb2@user1
                 Displaying column types/names for database connection of
                 layer 1:
                 INTEGER|cat

=> similar error messages for v.rast.stat

         g.region -p rast=elevation@PERMANENT

         v.rast.stats -e --verbose vector=vrandb2@user1
raster=elevation@PERMANENT colprefix=els

                 C:/OSGeo4W/apps/grass/grass-6.4.0RC3/scripts/v.rast.stats:
                 eval: line 1: unexpected EOF while looking for matching
`''
                 C:/OSGeo4W/apps/grass/grass-6.4.0RC3/scripts/v.rast.stats:
                 eval: line 2: syntax error: unexpected end of file
                 C:/OSGeo4W/apps/grass/grass-6.4.0RC3/scripts/v.rast.stats:
                 GISDBASE: parameter null or not set

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/488&gt;
GRASS GIS <http://grass.osgeo.org>

#488: v.db.addcol/v.rast.stats not working
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: | Keywords: v.db.addcol v.rast.stats
  Platform: MSWindows Vista | Cpu: Unspecified
------------------------------+---------------------------------------------
Comment (by hellik):

if i execute the following command of the example above in the command-
line of the GRASS Gis Layer Manager:

v.db.addcol map=vrandb2@user1 columns="barea double precision"

i get the following message:

    Sorry <double> is not a valid option <=
    Sorry <precision"> is not a valid option <=
    Description:
    Adds one or more columns to the attribute table connected
    to a given vector map.
    Keywords:
    vector, database, attribute table
    Usage:
    v.db.addcol map=name [layer=value] columns=string
    [--verbose]
    [--quiet]
     Flags:
     --v Verbose module output
     --q Quiet module output
     Parameters:
       map Vector map for which to edit attribute table
     layer Layer where to add column
             default: 1
    columns Name and type of the new column(s) (types depend
    on database backend, but all support VARCHAR(), INT, DOUBLE
    PRECISION and DATE)

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/488#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#488: v.db.addcol/v.rast.stats not working
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: | Keywords: v.db.addcol v.rast.stats
  Platform: MSWindows Vista | Cpu: Unspecified
------------------------------+---------------------------------------------
Comment (by hellik):

i tried this also on the mingw32-commandline in Grass6-devel, build from
source rev. 36355 in the osgeo4w-tree:

GRASS 6.5.svn (nc_spm_08):c:/Users/syringia > v.db.addcol mygeodetic_pts
col="zval double precision"
c:/OSGeo4W/apps/grass/grass-6.5.svn/scripts/v.db.addcol: eval: line 1:
unexpected EOF while looking for matching `''
c:/OSGeo4W/apps/grass/grass-6.5.svn/scripts/v.db.addcol: eval: line 2:
syntax error: unexpected end of file
c:/OSGeo4W/apps/grass/grass-6.5.svn/scripts/v.db.addcol: GISDBASE:
parameter null or not set
GRASS 6.5.svn (nc_spm_08):c:/Users/syringia >

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/488#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#488: v.db.addcol/v.rast.stats not working
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: | Keywords: v.db.addcol v.rast.stats
  Platform: MSWindows Vista | Cpu: Unspecified
------------------------------+---------------------------------------------
Comment (by neteler):

Replying to [ticket:488 hellik]:
> g.gisenv --v
> GISDBASE='C:\gisdata\grassdata';
> LOCATION_NAME='gisdemo_ncspm';
> MAPSET='user1';
> GRASS_GUI='wxpython';
> "DEBUG='3"';

I just observed that the DEBUG row has incorrect syntax. If you today run
g.gisenv
again, does it look the same? If yes, either delete the row in
$HOME/.grassrc6 or
set it again with
{{{
g.gisenv set=DEBUG=3
}}}

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/488#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#488: v.db.addcol/v.rast.stats not working
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: | Keywords: v.db.addcol v.rast.stats
  Platform: MSWindows Vista | Cpu: Unspecified
------------------------------+---------------------------------------------
Comment (by neteler):

Replying to [comment:2 hellik]:
> i tried this also on the mingw32-commandline in Grass6-devel, build from
source rev. 36355 in the osgeo4w-tree:
>
> GRASS 6.5.svn (nc_spm_08):c:/Users/syringia > v.db.addcol mygeodetic_pts
col="zval double precision"
> c:/OSGeo4W/apps/grass/grass-6.5.svn/scripts/v.db.addcol: eval: line 1:
unexpected EOF while looking for matching `''
> c:/OSGeo4W/apps/grass/grass-6.5.svn/scripts/v.db.addcol: eval: line 2:
syntax error: unexpected end of file

Two ideas

- http://lists.osgeo.org/pipermail/grass-dev/2009-March/042879.html

- OSGeo "shell" package needs to be installed?

Just guessing,
Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/488#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#488: v.db.addcol/v.rast.stats not working
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: | Keywords: v.db.addcol v.rast.stats
  Platform: MSWindows Vista | Cpu: Unspecified
------------------------------+---------------------------------------------
Comment (by hellik):

Replying to [comment:3 neteler]:
> Replying to [ticket:488 hellik]:
> > g.gisenv --v
> > GISDBASE='C:\gisdata\grassdata';
> > LOCATION_NAME='gisdemo_ncspm';
> > MAPSET='user1';
> > GRASS_GUI='wxpython';
> > "DEBUG='3"';
>
> I just observed that the DEBUG row has incorrect syntax. If you today
run g.gisenv
> again, does it look the same? If yes, either delete the row in
$HOME/.grassrc6 or
> set it again with
> {{{
> g.gisenv set=DEBUG=3
> }}}
>
> Markus

i had to delete the row in $HOME/.grassrc6 and set it again, now it's look
ok like:

GISDBASE='C:\gisdata\grassdata';
LOCATION_NAME='nc_spm_08';
MAPSET='user1';
GRASS_GUI='wxpython';
DEBUG='3';

Helmut

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/488#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#488: v.db.addcol/v.rast.stats not working
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: fixed | Keywords: v.db.addcol v.rast.stats
  Platform: MSWindows Vista | Cpu: Unspecified
------------------------------+---------------------------------------------
Changes (by hellik):

  * status: new => closed
  * resolution: => fixed

Comment:

Replying to [comment:4 neteler]:
> Replying to [comment:2 hellik]:
> > i tried this also on the mingw32-commandline in Grass6-devel, build
from source rev. 36355 in the osgeo4w-tree:
> >
> > GRASS 6.5.svn (nc_spm_08):c:/Users/syringia > v.db.addcol
mygeodetic_pts col="zval double precision"
> > c:/OSGeo4W/apps/grass/grass-6.5.svn/scripts/v.db.addcol: eval: line 1:
unexpected EOF while looking for matching `''
> > c:/OSGeo4W/apps/grass/grass-6.5.svn/scripts/v.db.addcol: eval: line 2:
syntax error: unexpected end of file
>
> Two ideas
>
> - http://lists.osgeo.org/pipermail/grass-dev/2009-March/042879.html
>
> - OSGeo "shell" package needs to be installed?
>
> Just guessing,
> Markus

build GRASS6.5 from source, svn 36355, in the osgeo4w-tree on Win Vista

i started Grass 6.5 from the Osgeo4W-Shell
after setting correct debug=3 and tried the above v.db.addcol-command.

now the column seems to be added:

db.columns --verbose table=mygeodetic_pts
cat
OBJECTID
[..]
SCALE
ANGLE
zvala <=
zvalb <=

and

db.describe table=mygeodetic_pts
[...]
column:zvalb
description:
type:DOUBLE PRECISION
len:20
scale:6
precision:18
default:
nullok:yes
select:yes
update:yes

but i tried it again from the wx-gui-command-line, there is the first
error again:

v.db.addcol mygeodetic_pts col="zvalc double precision"
Sorry <double> is not a valid option
Sorry <precision"> is not a valid option
[...]

so adding the osgeo4w-shell would be maybe a part of the solution. but the
wx-command-line should also work?

all the best
Helmut

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/488#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#488: v.db.addcol/v.rast.stats not working
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: | Keywords: v.db.addcol v.rast.stats
  Platform: MSWindows Vista | Cpu: Unspecified
------------------------------+---------------------------------------------
Changes (by hellik):

  * status: closed => reopened
  * resolution: fixed =>

Comment:

there was short out-of-working-time of trac which closed the ticket
Helmut

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/488#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#488: v.db.addcol/v.rast.stats not working
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: | Keywords: v.db.addcol v.rast.stats
  Platform: MSWindows Vista | Cpu: Unspecified
------------------------------+---------------------------------------------
Comment (by neteler):

Replying to [comment:6 hellik]:
...
> but i tried it again from the wx-gui-command-line, there is the first
error again:
>
> v.db.addcol mygeodetic_pts col="zvalc double precision"
> Sorry <double> is not a valid option
> Sorry <precision"> is not a valid option
> [...]
>
> so adding the osgeo4w-shell would be maybe a part of the solution.

(Please try the osgeo4w-shell)

> but the wx-command-line should also work?

No, see trac #528 - the wx-command-line is currently eating the "" to my
knowledge.

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/488#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#488: v.db.addcol/v.rast.stats not working
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: | Keywords: v.db.addcol v.rast.stats
  Platform: MSWindows Vista | Cpu: Unspecified
------------------------------+---------------------------------------------
Comment (by hellik):

Replying to [comment:8 neteler]:
> Replying to [comment:6 hellik]:
> ...
> > but i tried it again from the wx-gui-command-line, there is the first
error again:
> >
> > v.db.addcol mygeodetic_pts col="zvalc double precision"
> > Sorry <double> is not a valid option
> > Sorry <precision"> is not a valid option
> > [...]
> >
> > so adding the osgeo4w-shell would be maybe a part of the solution.
>
> (Please try the osgeo4w-shell)
>
> > but the wx-command-line should also work?
>
> No, see trac #528 - the wx-command-line is currently eating the "" to my
knowledge.
>
> Markus

maybe badly explained in my reply before by me:
"i started Grass 6.5 from the Osgeo4W-Shell after setting correct debug=3
and tried the above v.db.addcol-command."

the v.db.addcol-command was applied in the osgeo4w-shell by me and is
working there. :o)

so therefore "adding the osgeo4w-shell" would be a part of the solution.

and my second "question":
"but the wx-command-line should also work?"

i've got to this (trac #528) by working out the examples in www.grass-
book.org (the examples with r.mapcalc), so IMHO wx-command-line should
should work before WinGrass with WxGUI goes out in the wild.

all the best
Helmut

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/488#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#488: v.db.addcol/v.rast.stats not working
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: fixed | Keywords: v.db.addcol v.rast.stats
  Platform: MSWindows Vista | Cpu: Unspecified
------------------------------+---------------------------------------------
Changes (by hamish):

  * status: reopened => closed
  * resolution: => fixed

Comment:

AFAIK this was fixed a couple of months ago and the wx Cmd> prompt now
parses bourne-like quoting syntax successfully.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/488#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>