[Qgis-user] Editing dbf attributes via Python Console

stefaan dondeyne stefaan_dondeyne at yahoo.co.uk
Mon Nov 3 08:25:37 PST 2008


Hi Paolo, 

Because the table manager - has still far too many limitations ...

For example

This afternoon I was working on a legend of a vegetation map - the legend is in portuguese, so we use some "special" characters in as you'd find in the word vegetação 

I wanted to modify the table by additional colum for having a simplied key - I can do that with the table manager - but then I already will have to save the new shape.  OK that has advantages and disadvantages - so let me do it ... 

(1) by the sheer fact of adding a colum to the table say "veg_general" - in the original table all records get affected with text using special characters so e.g. in the field "vegetation" something which was 

- "Savana arbórea" is transformed into "Savana arbórea" or 
"Plantação florestal" into "Plantação florestal" 

prety annoying if you want to use that for your legend...

(2) The next point is that with the table manager I don't know any way (but please tell me if there is), for quickly selecting a couple of categories to generalize into a new category - e.g. records with "evergreen forest" and "dense forest" (in the field "vegetation") combining into one new category such as "dense or evergreen forest" (in the field "veg_general").

I am used updating and modifying such a table in excel - making use of a lookup function would be fast - but on the machine I was working this afternoon they have MS-Office 2007 - and ... that does allow opening a dbf-file but not saving anymore as a dbf file.  Well OK one more good argument for not using MS-Office ...

But, I have tried doing it with OpenOffice Calc - but that doesn't give me good results (some link between table and maps get lost and so thing get screwed up) - so in this case I simply reverted using old ArcView 3.2 where these operations can be done easily and without any of the abover described problems.  But of course, the purpose of me using qGIS is exactly that I want to offer to local government institutions in Mozambique a good and legal alternative for ArcView - which they can't afford paying for anyway ... hence my frustration and this writing.

But, OK from this discussion I have taken the tip of trying it next time with OpenOffice dbase  I must confess not having experience yet with that programme.

If you'd have time giving more tips - I'll be greatful - It's a pity qGIS still fall short on such parts

Regards 

Stefaan
 
_________________________________________________
Stefaan Dondeyne (PhD)
Ecologist/Environmental Advisor
CP 121 Chimoio - Mozambique
Cell 82 733 24 14
_________________________________________________
http://www.actf.gov.mz/reserva_chimanimani.html
http://www.mozambiqueflora.com/index.php
http://micaia.org/centre/micaia_family.html




________________________________
From: Paolo Cavallini <cavallini at faunalia.it>
To: maning sambale <emmanuel.sambale at gmail.com>
Cc: qgis-user at lists.osgeo.org
Sent: Monday, 3 November, 2008 14:26:48
Subject: Re: [Qgis-user] Editing dbf attributes via Python Console

Why not using the table manager plugin?
All the best.
pc

> Here's my python console challenge for QGIS.
>
> I need to edit the dbf attributes of a GRASS vector in QGIS.  I
> usually load grass vectors in QGIS (via GRASS plugin).

-- 
Paolo Cavallini
http://faunalia.it/pc


_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20081103/7df5dd16/attachment.html>


More information about the Qgis-user mailing list