[GRASS-dev] [grass-code I][537] d.vect and d.vect.thematic
attributes from other layers than 1
grass-dev at grass.itc.it
grass-dev at grass.itc.it
Fri Nov 23 08:01:58 EST 2007
code I item #537, was opened at 2007-11-23 14:01
Status: Open
Priority: 3
Submitted By: Harri Kiiskinen (harrikoo)
Assigned to: Nobody (None)
Summary: d.vect and d.vect.thematic attributes from other layers than 1
Issue type: library bug
Issue status: None
GRASS version: CVS HEAD
GRASS component: None
Operating system: Linux
Operating system version: Debian testing
GRASS CVS checkout date, if applies (YYMMDD): 071122
Initial Comment:
It seems, that neither d.vect nor d.vect.thematic can any more display labels based on attributes other layers than 1. Example:
GRASS 6.3.cvs (TS): > v.db.connect -p allfindspots
Vector map <allfindspots> is connected by:
layer <1> table <overall.allfindspots> in database <host=localhost,dbname=TS> through driver <pg> with key <id>
layer <10> table <overall.sites_amounts10> in database <host=localhost,dbname=TS,port=5432> through driver <pg> with key <id>
GRASS 6.3.cvs (TS): > v.db.connect -c allfindspots layer=1
CHARACTER|findspot
INTEGER|id
CHARACTER|alternative_name
CHARACTER|modern_country
CHARACTER|roman_province
DOUBLE PRECISION|latitude
DOUBLE PRECISION|longitude
GRASS 6.3.cvs (TS): > d.vect.thematic -s map=allfindspots at overall type=point column=id layer=1 icon=basic/circle size=5 maxsize=20 nint=4 pointcolor=255:0:0 linecolor=0:0:0 startcolor=255:0:0 endcolor=0:0:255 themetype=graduated_points monitor=none themecalc=interval colorscheme=blue-green
produces nice map, see map1.png
But:
GRASS 6.3.cvs (TS): > v.db.connect -c allfindspots layer=10
INTEGER|id
CHARACTER|site
INTEGER|amount
GRASS 6.3.cvs (TS): > d.vect.thematic -s map=allfindspots at overall type=point column=id layer=10 icon=basic/circle size=5 maxsize=20 nint=4 pointcolor=255:0:0 linecolor=0:0:0 startcolor=255:0:0 endcolor=0:0:255 themetype=graduated_points monitor=none themecalc=interval colorscheme=blue-green
outputs:
Thematic map legend for column id of map allfindspots at overall
Value range: 1 - 843
Mapped by 4 intervals of 210.5
Size/width Value
========== =====
PNG: GRASS_TRUECOLOR status: FALSE
PNG: collecting to file: map.png,
GRASS_WIDTH=640, GRASS_HEIGHT=480
Graphics driver [PNG] started
20 632.5 - 843
15 422 - 632.5
10 211.5 - 422
5 1 - 211.5
Monitor 'PNG' terminated
But the map is empty.
In addition:
GRASS 6.3.cvs (TS): > d.vect.thematic -s map=allfindspots at overall type=point column=amount layer=10 icon=basic/circle size=5 maxsize=20 nint=4 pointcolor=255:0:0 linecolor=0:0:0 startcolor=255:0:0 endcolor=0:0:255 themetype=graduated_points monitor=none themecalc=interval colorscheme=blue-green
ERROR: No such column [amount]
Although v.db.connect above did show the column. And yes, the data is in the table. The database connection is working fine, I can list the tables and do whatever.
So on layer 1, all the column can be accessed; on layer 10, only the key-column; others "do nnot exist".
I guess this might as well be a database driver problem.
Debugging:
Debugging in the "missing column" case does not help:
D2/5: filename = /usr/lib/grass/scripts/d.vect.thematic
D2/5: set GIS_FLAG_G=0
D2/5: set GIS_FLAG_L=0
D2/5: set GIS_FLAG_F=0
D2/5: set GIS_FLAG_U=0
D2/5: set GIS_FLAG_S=1
D2/5: set GIS_FLAG_M=0
D2/5: set GIS_OPT_MAP=allfindspots at overall
D2/5: set GIS_OPT_TYPE=point
D2/5: set GIS_OPT_COLUMN=amount
D2/5: set GIS_OPT_THEMETYPE=graduated_points
D2/5: set GIS_OPT_THEMECALC=interval
D2/5: set GIS_OPT_BREAKPOINTS=
D2/5: set GIS_OPT_LAYER=10
D2/5: set GIS_OPT_ICON=basic/circle
D2/5: set GIS_OPT_SIZE=5
D2/5: set GIS_OPT_MAXSIZE=20
D2/5: set GIS_OPT_NINT=4
D2/5: set GIS_OPT_COLORSCHEME=blue-green
D2/5: set GIS_OPT_POINTCOLOR=255:0:0
D2/5: set GIS_OPT_LINECOLOR=0:0:0
D2/5: set GIS_OPT_STARTCOLOR=255:0:0
D2/5: set GIS_OPT_ENDCOLOR=0:0:255
D2/5: set GIS_OPT_MONITOR=none
D2/5: set GIS_OPT_WHERE=
D2/5: set GIS_OPT_PSMAP=
D2/5: set GIS_OPT_GROUP=
D2/5: G__home home = /home/harri
ERROR: No such column [amount]
In the case where the key field is used (i.e. att=id), I get different
different results (see attached debug log)
I have checked this with different maps in different locations and mapsets using different tables, but have found no explanations. One old map (over 2 years) does show attrbutes from layer 100 with d.vect and d.vect.thematic, but I cannot create new maps that do the same.
Perhaps this is a PostgreSQL driver bug, after all?
Best,
Harri K.
----------------------------------------------------------------------
You can respond by visiting:
http://wald.intevation.org/tracker/?func=detail&atid=204&aid=537&group_id=21
More information about the grass-dev
mailing list