[GRASS-user] Labels in GRASS 7 - Do I do wrong or is this a bug?

Philipp von Vangerow philipp.vonvangerow at gmail.com
Tue Nov 3 10:36:50 PST 2015


Dear people,

in GRASS GIS 6.4.4 I succesfully display labels in a vector map, in GRASS
7.0.2 it fails. I am not sure whethere I do something wrong or if this is a
bug in GRASS 7.x. See my documentation. I described every step and made
screenshots.

And: I checked here (
https://trac.osgeo.org/grass/query?status=assigned&status=new&status=reopened&type=defect&desc=1&order=id)
for open issues related to labels, but I found nothing that describes my
problem.

== Fehlersuche Labels ==
* Grass 6.4.4 - WinGRASS-6.4.4-1-Setup.exe
* Grass 7.0.2 - WinGRASS-7.0.2RC1-1-Setup.exe
* Grass 7.1   - WinGRASS-7.1.svn-r66704-108-Setup.exe
installed.

=== Grass 6 ===
Steps:
 evtl.: g.remove -f vect=test644
 v.edit tool=create map=test644 layer=1
 v.db.addtable map=test644 layer=1 columns="name VARCHAR(12),color
VARCHAR(11),info VARCHAR(128)"
 d.vect -a map=test644 display=shape,attr rgb_column=color
icon=basic/circle size=17 attrcol=name lcolor=black bgcolor=yellow lsize=17

Output:
 Using vector map name as table name: test644
 Creating new DB connection based on default mapset settings...
 Creating table with columns (cat integer, name VARCHAR(12), color
VARCHAR(11), info VARCHAR(128))
 Die Tabelle <test644> ist jetzt Teil der Vektorkarte <test644> und kann
mit GRASS Modulen gelöscht und überschrieben werden.
 Select-Privilegien wurden für die Tabelle gewährt.
 Lese Objekte...
 Aktualisiere die Datenbank...
 0 Datensätze aktualisiert/eingefügt (Layer 1).
 Layer <1> Tabelle <test644> in der Datenbank <E:\Users\Philipp von
Vangerow.MIR\grassdata\KML_EPSG_4326_Location\playground\sqlite\sqlite.db>
mit dem Treiber <sqlite> und der Schlüsselspalte <cat>
 Current attribute table links:
 Vectorkarte <test644 at playground> ist verbunden durch:

Start geodata creation via the GUI
Ebene 1/Kategorie 1
* name: Foo
* color: 249:247:166
* info: Hey there I am Foo!!!
Ebene 1/Kategorie 2
* name: Bar
* color: 65:134:240
* info: Hey there it is me, Bar!!!

Result:
[[Bild:GRASS GIS Fehlerbeschreibung missing labels - Version 6.4.4.jpg]]

=== GRASS 7.0.2 ===

 evtl.: g.remove -f type=vect name=test702
 v.edit tool=create map=test702 layer=1
 v.db.addtable --verbose map=test702 layer=1 columns=name VARCHAR(12),color
VARCHAR(11),info VARCHAR(128)
 d.vect -i map=test702 layer=1 display=shape rgb_column=color
icon=basic/circle size=17 attribute_column=name label_color=black
label_bgcolor=yellow label_size=17

Output:
 Creating table with columns (cat integer,name varchar(12),color
varchar(11),info varchar(128))...

Start geodata creation via the GUI
Ebene 1/Kategorie 1
* name: Foo
* color: 249:247:166
* info: Hey there I am Foo!!!
Ebene 1/Kategorie 2
* name: Bar
* color: 65:134:240
* info: Hey there it is me, Bar!!!

See there, got the background but not the text
[[Bild:GRASS GIS Fehlerbeschreibung missing labels - Version 7.0.2 Column
name.jpg]]

I change to the Info, so I get a much longer background. So this means for
computing the size of the background the program succesfullky had access to
the attributes. It can only know the larger field size from the longer text!
 d.vect -i map=test702 layer=1 display=shape rgb_column=color
icon=basic/circle size=17 attribute_column=info label_color=black
label_bgcolor=yellow label_size=17
[[Bild:GRASS GIS Fehlerbeschreibung missing labels - Version 7.0.2 Column
info.jpg]]

=== GRASS 7.1svn ===

 evtl.: g.remove -f type=vect name=test72svn
 v.edit tool=create map=test72svn layer=1
 v.db.addtable --verbose map=test72svn layer=1 columns="name
VARCHAR(12),color VARCHAR(11),info VARCHAR(128)"
 d.vect -i map=test72svn layer=1 display=shape rgb_column=color
icon=basic/circle size=17 attribute_column=name label_color=black
label_bgcolor=yellow label_size=17

 v.db.addtable --verbose map=test72svn layer=1 columns=name
VARCHAR(12),color VARCHAR(11),info VARCHAR(128)
 Using vector map name as table name: <test72svn>
 DB settings already defined, nothing to do
 Creating new DB connection based on default mapset settings...
 Creating table with columns (cat integer,name varchar(12),color
varchar(11),info varchar(128))...
 ERROR: Layerindex außerhalb des Wertebereichs.
 Traceback (most recent call last):
   File "C:\Program Files (x86)\GRASS GIS
 7.1.svn/scripts/v.db.addtable.py", line 150, in <module>
     sys.exit(main())
   File "C:\Program Files (x86)\GRASS GIS
 7.1.svn/scripts/v.db.addtable.py", line 137, in main
     option = 'cat', column = key, qlayer = layer)
   File "C:\Program Files (x86)\GRASS GIS
 7.1.svn\etc\python\grass\script\core.py", line 409, in
 run_command
     return handle_errors(returncode, returncode, args,
 kwargs)
   File "C:\Program Files (x86)\GRASS GIS
 7.1.svn\etc\python\grass\script\core.py", line 328, in
 handle_errors
     returncode=returncode)
 grass.exceptions.CalledModuleError: Module run None
 ['v.to.db', 'column=cat', 'map=test72svn', 'layer=1',
 'qlayer=1', 'option=cat'] ended with error
  Process ended with non-zero return code 1. See errors in the
 (error) output.

S...! OK, in the latest daily build I cannot check because of this error.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20151103/51544a8a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GRASS GIS 6.4.4 Foo-Bar.jpg
Type: image/jpeg
Size: 30718 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20151103/51544a8a/attachment-0003.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GRASS GIS 7.0.2 Foo-Bar info attr.jpg
Type: image/jpeg
Size: 26596 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20151103/51544a8a/attachment-0004.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GRASS GIS 7.0.2 Foo-Bar name attr.jpg
Type: image/jpeg
Size: 22477 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20151103/51544a8a/attachment-0005.jpg>


More information about the grass-user mailing list