2

I'm very new to GIS technology and have been trying to learn qGIS through downloaded tutorials. My qGIS is the 2.14.21 version. It was going well until the instructions told me to edit the attribute table of one of my layers (a sqlite layer with a polygon geometry type). The edit button is 'greyed' out, not allowing me to access this function. Why is this? I have tried various ways of selecting the data, restarting the program, and accessing the table through different buttons. The 'add a new field' button is also greyed, though the field calculator is functional. My online research hasn't come up with answers yet. Image below is what I see when I open the attribute table

6
  • Try selecting the layer and toggle edit mode... – Gerardo Jimenez Dec 27 '17 at 20:40
  • How can I toggle edit mode if it is grey and not allowing me to access its function? – K.Wright Dec 29 '17 at 0:51
  • Can you edit the attribute table of other layers? – csk Jan 2 '18 at 19:20
  • Unfortunately no I can't. The same greyed out edit button is there too – K.Wright Jan 3 '18 at 0:30
  • 1
    Your table may lack a primary key to be editable. This usually happens with OSM data put into a pgsql database with osm2pgsql. Not sure how you populated your sqlite layer. Maybe related: gis.stackexchange.com/questions/157541/… – AndreJ Apr 24 '18 at 9:52
6

This can happen if you don't have permission to edit the layer. Outside of QGIS, open the folder that the layer is in, right-click on the layer, and open Properties > Security. Where it says "Permissions for [username]" there should be a check next to "Modify" and "Write." If not, change the permissions for that file. If you don't have permission to change the permissions (a rather infuriating logic loop), save a copy of the layer to a folder that you can edit, and work from the copy.

2
  • What might the issue be if both those are checked under security? Because both are checked. – K.Wright Dec 30 '17 at 3:35
  • It's also possible to set a layer as read-only under Project > Project Properties > Identify Layers. – csk Jan 10 '18 at 20:29
1

Try "Toggling editing" from the right click menu in the Layers Panel BEFORE opening the attribute table - it worked for me!

1

In my case, layer was "read-only" in Project-Properties-Data Sources

1

You have to save the layer, for instance I add data from a *.csv file and you will work perfect with that data but if you don't save the layer as a shapefile using right click > save object or similar (I have qgis in spanish) you are not going to be able to edit it.

0

I had the same issue when I added the shapefile by Add vector layer - browsed to a zip file and then selected the shapefiles it offered. When I unzipped it, went to Add vector layer and directly selected the shapefile I want to add (as opposed to the zip file), the Toggle Edit option became active.

0

I have come across this issue. The easiest way worked with me is check if you have primary key in your data. If not, add one and reload the feature and try editing. But because shapefile does not have a primary key concept, you can use field calculator to create a column that utilizes row or record number as its value.

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