I'm editing a lot of polygons of a shapefile in QGIS and i need to classify them, so i have to write the classes a repetedly a lot of times. In ArcMap there is an option to have domains set for the fields. How do i do this in QGIS? Thanks
-
I would like to classify features in an existing shapefile. Is there a way to make a menu pop up when I select an existing feature and allow selection/typing of a classification value. The above description seems to only work for new features? Thanks Axel– user18293May 18, 2013 at 22:48
2 Answers
You can customize the attribute editing to various data types (predefined lists, a range of values or a date).
- Select a layer.
Right-click > Properties
. - In the Properties window, click the
Field
tab. - Select any field you want your pre-defined classes. The
Value Map
option will ask for your pre-defined classification values.
When you start adding new polygons a drop down list should appear showing your list of classes. The below screenshot is from QGIS 1.7.
-
Is it possible to pull the pre-defined classification values from 1) a separate table of values or 2) values that currently exist within the table/field being edited? Option #1 would be similar to coded-value domains in ArcGIS. Jul 18, 2011 at 22:24
-
Yes, using the
Value map
, you can either: 1) Load data from an existing attribute table or; 2? Load data from a CSV file.– maningJul 19, 2011 at 1:35 -
Fantastic! Do you know of any plans to allow a "live-linked" table, as opposed to a simple one-time load from table? Jul 19, 2011 at 5:24
-
I'm not aware of any plans. You can try talking to the qgis-developers via the qgis-dev list: lists.osgeo.org/mailman/listinfo/qgis-developer– maningJul 19, 2011 at 11:25
-
QGIS 3.x now has a "Attributes Forms" tab. In the "Widget Type" I am able to select "Value Map" and add a CSV file or pull from another layer. This did not update the drop down list however when I added a new value to the layer. @RyanKDalton There is also a "Value Relation" option and hallelujah this sets up a "live-link" to another table for drop down values.– bendeckoJun 8, 2021 at 9:00
The nice thing of having widget type with value map is that it also works on existing features. Just click on it with the i+arrow (identify feature or CTRL+SHIFT+I) to get the menu back with options to choose from. I have virtual fields depending on the chosen item and it works as a charm