Opened 11 years ago

Closed 10 years ago

#488 closed defect (fixed)

v.db.addcol/v.rast.stats not working

Reported by: hellik Owned by: grass-dev@…
Priority: major Milestone: 6.4.0
Component: Vector Version: 6.4.0 RCs
Keywords: v.db.addcol v.rast.stats Cc:
CPU: Unspecified Platform: MSWindows Vista

Description

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

Change History (10)

comment:1 Changed 11 years ago 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)

comment:2 Changed 11 years ago 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 >

comment:3 in reply to:  description ; Changed 11 years ago by neteler

Replying to 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

comment:4 in reply to:  2 ; Changed 11 years ago by neteler

Replying to 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

  • OSGeo "shell" package needs to be installed?

Just guessing, Markus

comment:5 in reply to:  3 Changed 11 years ago by hellik

Replying to neteler:

Replying to 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

comment:6 in reply to:  4 ; Changed 11 years ago by hellik

Resolution: fixed
Status: newclosed

Replying to neteler:

Replying to 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

  • 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

comment:7 Changed 11 years ago by hellik

Resolution: fixed
Status: closedreopened

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

comment:8 in reply to:  6 ; Changed 11 years ago by neteler

Replying to 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

comment:9 in reply to:  8 Changed 11 years ago by hellik

Replying to neteler:

Replying to 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

comment:10 Changed 10 years ago by hamish

Resolution: fixed
Status: reopenedclosed

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

Note: See TracTickets for help on using tickets.