Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

s there a opportunity to use subtypes and domains in QGIS (Desktop 1.8.0) like the way you use in ArcGIS?

I´m specially interested in the possibility of dependencies between subtypes and domains: not only a range oder codes values for one field is required but corresponding values. For example: a subtypes defines valid classes of land use categories like

01 - wood

02 - grassland

03 - urbanization,...

Associated to the subtype there are several domains describing the condition/worth of each category like

wood1 - deforestation

wood2 - conifer forest

grass1 - pasture

grass2 - hayfield

grass3 - grass, ...

Thanks for help!

share|improve this question
add comment

1 Answer 1

If you use a database backend that supports domains, such as Postgresql, you can set a domain on a field. However, QGIS doesn't recognize domains yet so as you create or edit features you can try to put anything into that field, there is no dropbox like in ESRI's products. If the values violate the constraint of the domain you'll get an error when you try to save your edits and the transaction won't commit.

Edit: I tested this with QGIS 1.8 and PostgreSQL 9.1.6

share|improve this answer
1  
Thank you. I used this domain function in qgis and it worked fine. But is it also possible to deposit a relation between two attributes? e.g. when I choose "wood" for the first field (subtype in ArcGIS) the second field only accepts "deforestation" or "conifer forest" (domain for subtype "wood"). When the first attribute is "grassland" there is only "pasture", "hayfield" oder "grass" to select. –  Mira Dec 11 '12 at 16:08
    
I have looked at this, but all the examples I find require you to create a new table. I have an existing table with data, that I would like to have domains for. IE: In table1 there are 3 types of data stored as Integer (1: Tree, 2: Rock, 3: Pond). With this setup the user sees the Integer, but I would like to have a Domain so the user sees the Text version. How would you set this up with Postgres and QGIS? –  Ryan Garnett Jun 24 '13 at 23:41
    
Create a lookup table that translates the integer value to text, join the two in a view and display the view in QGIS. When you create the view you'll have to include a field that has a unique integer value for each row otherwise QGIS won't display it. –  HeyOverThere Jun 25 '13 at 15:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.