Does anybody know how to display the geoemtry type of features in the attribute table?
1 Answer
Use field calculator with function geom_to_wkt
which gives you WKT representation (geometry type, coordinates). Then add some string handling for gain only geometry type:
left(geom_to_wkt($geometry),strpos(geom_to_wkt($geometry),' ')-1)
strpos
takes position of first space (' '
) character in whole WKT string and print this number (-1 for removing extra space) of characters from the left. The result will be geometry type (Polygon
, MultiPolygon
etc.).
If you need to keep this attribute updated, check Create virtual field. How virtual fields work is described in Editing attribute values in QGIS documentation.