Allowing all QGIS workspace layers to be editable at once

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












4














I stumbled upon an odd behaviour of layers in QGIS 3.4 brought from PostGIS. The first layers I brought to the project are always editable together when clicking the Toggle Edit-button, but some of the other layers are editable only when separately selected. These layers have been brought to the project afterwards. I have tested this in 3.4.0 and 3.4.2. with Windows (as QGS and QGZ). Also when the same project was used by others in their own environment, all the layers had to be separately changed to editable. This causes problems because there are relations between the tables and you have to know what tables should be editable. How can I make all the layers editable at once?



Edit: Noticed that when the same layers are brought to a new project, they have to be clicked editable one at a time. I have used Project Generator tool to create the layers and some of the relations between the layers.



Here an example of the problem










share|improve this question



















  • 1




    Welcome to GIS.SE! Are the layers brought afterwards from the same PostGIS DB? If so, did you try to check Automatically create transaction groups where possible under Project > Project Properties > Data Sources ?
    – Jochen Schwarze
    Dec 12 at 10:15











  • Yes, the layers are from the same database but the first ones were brought with QGIS Project Generator tool (that also brought the relations) the other layers were brought afterwards through normal add layer method. The transaction groups is by default checked. The most bizarre thing is that the same project (qgs) behaves differently in other setup with our client. But we'll have to check if they have that button checked.
    – Sanna Jokela
    Dec 12 at 13:37










  • Our client has the transaction groups checked, but the layers are still not editable at once. Starting to think this is due some PostGIS connections / user rights. In my case the layers think that they are coming from different places (because of the tool I have used). I tested by adding some layers through Project Generator tool and some layers from Add layers > Add PostGIS layers and they don't "group" with each other. So, do you know @jochen or somebody else, can you do something else in QGIS project to force QGIS to see the wanted transaction groups?
    – Sanna Jokela
    Dec 13 at 8:04










  • And the result was that our clients difference in the project was due to database user rights. When the user rights were given to the database (not separate schemas), everything went well. The reason why my project does not understand the connections between the layers was probably the use of Project Generator tool. I can fetch the ill behaving layers from there if I need to, so thank you all for the suggestions!
    – Sanna Jokela
    Dec 13 at 12:52















4














I stumbled upon an odd behaviour of layers in QGIS 3.4 brought from PostGIS. The first layers I brought to the project are always editable together when clicking the Toggle Edit-button, but some of the other layers are editable only when separately selected. These layers have been brought to the project afterwards. I have tested this in 3.4.0 and 3.4.2. with Windows (as QGS and QGZ). Also when the same project was used by others in their own environment, all the layers had to be separately changed to editable. This causes problems because there are relations between the tables and you have to know what tables should be editable. How can I make all the layers editable at once?



Edit: Noticed that when the same layers are brought to a new project, they have to be clicked editable one at a time. I have used Project Generator tool to create the layers and some of the relations between the layers.



Here an example of the problem










share|improve this question



















  • 1




    Welcome to GIS.SE! Are the layers brought afterwards from the same PostGIS DB? If so, did you try to check Automatically create transaction groups where possible under Project > Project Properties > Data Sources ?
    – Jochen Schwarze
    Dec 12 at 10:15











  • Yes, the layers are from the same database but the first ones were brought with QGIS Project Generator tool (that also brought the relations) the other layers were brought afterwards through normal add layer method. The transaction groups is by default checked. The most bizarre thing is that the same project (qgs) behaves differently in other setup with our client. But we'll have to check if they have that button checked.
    – Sanna Jokela
    Dec 12 at 13:37










  • Our client has the transaction groups checked, but the layers are still not editable at once. Starting to think this is due some PostGIS connections / user rights. In my case the layers think that they are coming from different places (because of the tool I have used). I tested by adding some layers through Project Generator tool and some layers from Add layers > Add PostGIS layers and they don't "group" with each other. So, do you know @jochen or somebody else, can you do something else in QGIS project to force QGIS to see the wanted transaction groups?
    – Sanna Jokela
    Dec 13 at 8:04










  • And the result was that our clients difference in the project was due to database user rights. When the user rights were given to the database (not separate schemas), everything went well. The reason why my project does not understand the connections between the layers was probably the use of Project Generator tool. I can fetch the ill behaving layers from there if I need to, so thank you all for the suggestions!
    – Sanna Jokela
    Dec 13 at 12:52













4












4








4







I stumbled upon an odd behaviour of layers in QGIS 3.4 brought from PostGIS. The first layers I brought to the project are always editable together when clicking the Toggle Edit-button, but some of the other layers are editable only when separately selected. These layers have been brought to the project afterwards. I have tested this in 3.4.0 and 3.4.2. with Windows (as QGS and QGZ). Also when the same project was used by others in their own environment, all the layers had to be separately changed to editable. This causes problems because there are relations between the tables and you have to know what tables should be editable. How can I make all the layers editable at once?



Edit: Noticed that when the same layers are brought to a new project, they have to be clicked editable one at a time. I have used Project Generator tool to create the layers and some of the relations between the layers.



Here an example of the problem










share|improve this question















I stumbled upon an odd behaviour of layers in QGIS 3.4 brought from PostGIS. The first layers I brought to the project are always editable together when clicking the Toggle Edit-button, but some of the other layers are editable only when separately selected. These layers have been brought to the project afterwards. I have tested this in 3.4.0 and 3.4.2. with Windows (as QGS and QGZ). Also when the same project was used by others in their own environment, all the layers had to be separately changed to editable. This causes problems because there are relations between the tables and you have to know what tables should be editable. How can I make all the layers editable at once?



Edit: Noticed that when the same layers are brought to a new project, they have to be clicked editable one at a time. I have used Project Generator tool to create the layers and some of the relations between the layers.



Here an example of the problem







qgis layers editing






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 12 at 15:14









Andy

930314




930314










asked Dec 12 at 9:57









Sanna Jokela

214




214







  • 1




    Welcome to GIS.SE! Are the layers brought afterwards from the same PostGIS DB? If so, did you try to check Automatically create transaction groups where possible under Project > Project Properties > Data Sources ?
    – Jochen Schwarze
    Dec 12 at 10:15











  • Yes, the layers are from the same database but the first ones were brought with QGIS Project Generator tool (that also brought the relations) the other layers were brought afterwards through normal add layer method. The transaction groups is by default checked. The most bizarre thing is that the same project (qgs) behaves differently in other setup with our client. But we'll have to check if they have that button checked.
    – Sanna Jokela
    Dec 12 at 13:37










  • Our client has the transaction groups checked, but the layers are still not editable at once. Starting to think this is due some PostGIS connections / user rights. In my case the layers think that they are coming from different places (because of the tool I have used). I tested by adding some layers through Project Generator tool and some layers from Add layers > Add PostGIS layers and they don't "group" with each other. So, do you know @jochen or somebody else, can you do something else in QGIS project to force QGIS to see the wanted transaction groups?
    – Sanna Jokela
    Dec 13 at 8:04










  • And the result was that our clients difference in the project was due to database user rights. When the user rights were given to the database (not separate schemas), everything went well. The reason why my project does not understand the connections between the layers was probably the use of Project Generator tool. I can fetch the ill behaving layers from there if I need to, so thank you all for the suggestions!
    – Sanna Jokela
    Dec 13 at 12:52












  • 1




    Welcome to GIS.SE! Are the layers brought afterwards from the same PostGIS DB? If so, did you try to check Automatically create transaction groups where possible under Project > Project Properties > Data Sources ?
    – Jochen Schwarze
    Dec 12 at 10:15











  • Yes, the layers are from the same database but the first ones were brought with QGIS Project Generator tool (that also brought the relations) the other layers were brought afterwards through normal add layer method. The transaction groups is by default checked. The most bizarre thing is that the same project (qgs) behaves differently in other setup with our client. But we'll have to check if they have that button checked.
    – Sanna Jokela
    Dec 12 at 13:37










  • Our client has the transaction groups checked, but the layers are still not editable at once. Starting to think this is due some PostGIS connections / user rights. In my case the layers think that they are coming from different places (because of the tool I have used). I tested by adding some layers through Project Generator tool and some layers from Add layers > Add PostGIS layers and they don't "group" with each other. So, do you know @jochen or somebody else, can you do something else in QGIS project to force QGIS to see the wanted transaction groups?
    – Sanna Jokela
    Dec 13 at 8:04










  • And the result was that our clients difference in the project was due to database user rights. When the user rights were given to the database (not separate schemas), everything went well. The reason why my project does not understand the connections between the layers was probably the use of Project Generator tool. I can fetch the ill behaving layers from there if I need to, so thank you all for the suggestions!
    – Sanna Jokela
    Dec 13 at 12:52







1




1




Welcome to GIS.SE! Are the layers brought afterwards from the same PostGIS DB? If so, did you try to check Automatically create transaction groups where possible under Project > Project Properties > Data Sources ?
– Jochen Schwarze
Dec 12 at 10:15





Welcome to GIS.SE! Are the layers brought afterwards from the same PostGIS DB? If so, did you try to check Automatically create transaction groups where possible under Project > Project Properties > Data Sources ?
– Jochen Schwarze
Dec 12 at 10:15













Yes, the layers are from the same database but the first ones were brought with QGIS Project Generator tool (that also brought the relations) the other layers were brought afterwards through normal add layer method. The transaction groups is by default checked. The most bizarre thing is that the same project (qgs) behaves differently in other setup with our client. But we'll have to check if they have that button checked.
– Sanna Jokela
Dec 12 at 13:37




Yes, the layers are from the same database but the first ones were brought with QGIS Project Generator tool (that also brought the relations) the other layers were brought afterwards through normal add layer method. The transaction groups is by default checked. The most bizarre thing is that the same project (qgs) behaves differently in other setup with our client. But we'll have to check if they have that button checked.
– Sanna Jokela
Dec 12 at 13:37












Our client has the transaction groups checked, but the layers are still not editable at once. Starting to think this is due some PostGIS connections / user rights. In my case the layers think that they are coming from different places (because of the tool I have used). I tested by adding some layers through Project Generator tool and some layers from Add layers > Add PostGIS layers and they don't "group" with each other. So, do you know @jochen or somebody else, can you do something else in QGIS project to force QGIS to see the wanted transaction groups?
– Sanna Jokela
Dec 13 at 8:04




Our client has the transaction groups checked, but the layers are still not editable at once. Starting to think this is due some PostGIS connections / user rights. In my case the layers think that they are coming from different places (because of the tool I have used). I tested by adding some layers through Project Generator tool and some layers from Add layers > Add PostGIS layers and they don't "group" with each other. So, do you know @jochen or somebody else, can you do something else in QGIS project to force QGIS to see the wanted transaction groups?
– Sanna Jokela
Dec 13 at 8:04












And the result was that our clients difference in the project was due to database user rights. When the user rights were given to the database (not separate schemas), everything went well. The reason why my project does not understand the connections between the layers was probably the use of Project Generator tool. I can fetch the ill behaving layers from there if I need to, so thank you all for the suggestions!
– Sanna Jokela
Dec 13 at 12:52




And the result was that our clients difference in the project was due to database user rights. When the user rights were given to the database (not separate schemas), everything went well. The reason why my project does not understand the connections between the layers was probably the use of Project Generator tool. I can fetch the ill behaving layers from there if I need to, so thank you all for the suggestions!
– Sanna Jokela
Dec 13 at 12:52










2 Answers
2






active

oldest

votes


















4














What @jochen-schwarze suggested, should work but if needed, you can put all vector layers that have been opened in the project to edit mode with the following code in QGIS 3:



layers = QgsProject.instance().mapLayers()
for layer in layers.values():
if isinstance(layer, QgsVectorLayer) and not layer.isEditable():
layer.startEditing()





share|improve this answer


















  • 1




    Thank you @orienteerix :) I think we have a workaround for this now. But still a bit baffled how to get some of the layers to the transactiongroup suggested by Jochen. But we can do this now! Thank you all!
    – Sanna Jokela
    Dec 12 at 14:50


















3














There is a chunk of code here - Set layer in edit mode in QGIS processing that may help. You can either put that in the Plugins/Python Counsel (Ctrl+Alt+P) or possibly write a small plugin with a button that launches this.



Click on the little "Show Editor" button paste your code and save it. Then run it with the green run button.



enter image description here



I am not sure if there is a plug-in for that specifically but you could look at the Digitizing Tools Plug-in and see if you can select more than one layer and set those to Edit.






share|improve this answer




















  • Thank you @caryhutchinson, we shall see if there is some help on this and report here (I have not used Python console my self, but my colleague can help)!
    – Sanna Jokela
    Dec 12 at 14:01










Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "79"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f305804%2fallowing-all-qgis-workspace-layers-to-be-editable-at-once%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














What @jochen-schwarze suggested, should work but if needed, you can put all vector layers that have been opened in the project to edit mode with the following code in QGIS 3:



layers = QgsProject.instance().mapLayers()
for layer in layers.values():
if isinstance(layer, QgsVectorLayer) and not layer.isEditable():
layer.startEditing()





share|improve this answer


















  • 1




    Thank you @orienteerix :) I think we have a workaround for this now. But still a bit baffled how to get some of the layers to the transactiongroup suggested by Jochen. But we can do this now! Thank you all!
    – Sanna Jokela
    Dec 12 at 14:50















4














What @jochen-schwarze suggested, should work but if needed, you can put all vector layers that have been opened in the project to edit mode with the following code in QGIS 3:



layers = QgsProject.instance().mapLayers()
for layer in layers.values():
if isinstance(layer, QgsVectorLayer) and not layer.isEditable():
layer.startEditing()





share|improve this answer


















  • 1




    Thank you @orienteerix :) I think we have a workaround for this now. But still a bit baffled how to get some of the layers to the transactiongroup suggested by Jochen. But we can do this now! Thank you all!
    – Sanna Jokela
    Dec 12 at 14:50













4












4








4






What @jochen-schwarze suggested, should work but if needed, you can put all vector layers that have been opened in the project to edit mode with the following code in QGIS 3:



layers = QgsProject.instance().mapLayers()
for layer in layers.values():
if isinstance(layer, QgsVectorLayer) and not layer.isEditable():
layer.startEditing()





share|improve this answer














What @jochen-schwarze suggested, should work but if needed, you can put all vector layers that have been opened in the project to edit mode with the following code in QGIS 3:



layers = QgsProject.instance().mapLayers()
for layer in layers.values():
if isinstance(layer, QgsVectorLayer) and not layer.isEditable():
layer.startEditing()






share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 12 at 14:55

























answered Dec 12 at 14:40









Orienteerix

348211




348211







  • 1




    Thank you @orienteerix :) I think we have a workaround for this now. But still a bit baffled how to get some of the layers to the transactiongroup suggested by Jochen. But we can do this now! Thank you all!
    – Sanna Jokela
    Dec 12 at 14:50












  • 1




    Thank you @orienteerix :) I think we have a workaround for this now. But still a bit baffled how to get some of the layers to the transactiongroup suggested by Jochen. But we can do this now! Thank you all!
    – Sanna Jokela
    Dec 12 at 14:50







1




1




Thank you @orienteerix :) I think we have a workaround for this now. But still a bit baffled how to get some of the layers to the transactiongroup suggested by Jochen. But we can do this now! Thank you all!
– Sanna Jokela
Dec 12 at 14:50




Thank you @orienteerix :) I think we have a workaround for this now. But still a bit baffled how to get some of the layers to the transactiongroup suggested by Jochen. But we can do this now! Thank you all!
– Sanna Jokela
Dec 12 at 14:50













3














There is a chunk of code here - Set layer in edit mode in QGIS processing that may help. You can either put that in the Plugins/Python Counsel (Ctrl+Alt+P) or possibly write a small plugin with a button that launches this.



Click on the little "Show Editor" button paste your code and save it. Then run it with the green run button.



enter image description here



I am not sure if there is a plug-in for that specifically but you could look at the Digitizing Tools Plug-in and see if you can select more than one layer and set those to Edit.






share|improve this answer




















  • Thank you @caryhutchinson, we shall see if there is some help on this and report here (I have not used Python console my self, but my colleague can help)!
    – Sanna Jokela
    Dec 12 at 14:01















3














There is a chunk of code here - Set layer in edit mode in QGIS processing that may help. You can either put that in the Plugins/Python Counsel (Ctrl+Alt+P) or possibly write a small plugin with a button that launches this.



Click on the little "Show Editor" button paste your code and save it. Then run it with the green run button.



enter image description here



I am not sure if there is a plug-in for that specifically but you could look at the Digitizing Tools Plug-in and see if you can select more than one layer and set those to Edit.






share|improve this answer




















  • Thank you @caryhutchinson, we shall see if there is some help on this and report here (I have not used Python console my self, but my colleague can help)!
    – Sanna Jokela
    Dec 12 at 14:01













3












3








3






There is a chunk of code here - Set layer in edit mode in QGIS processing that may help. You can either put that in the Plugins/Python Counsel (Ctrl+Alt+P) or possibly write a small plugin with a button that launches this.



Click on the little "Show Editor" button paste your code and save it. Then run it with the green run button.



enter image description here



I am not sure if there is a plug-in for that specifically but you could look at the Digitizing Tools Plug-in and see if you can select more than one layer and set those to Edit.






share|improve this answer












There is a chunk of code here - Set layer in edit mode in QGIS processing that may help. You can either put that in the Plugins/Python Counsel (Ctrl+Alt+P) or possibly write a small plugin with a button that launches this.



Click on the little "Show Editor" button paste your code and save it. Then run it with the green run button.



enter image description here



I am not sure if there is a plug-in for that specifically but you could look at the Digitizing Tools Plug-in and see if you can select more than one layer and set those to Edit.







share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 12 at 13:42









Cary H

588




588











  • Thank you @caryhutchinson, we shall see if there is some help on this and report here (I have not used Python console my self, but my colleague can help)!
    – Sanna Jokela
    Dec 12 at 14:01
















  • Thank you @caryhutchinson, we shall see if there is some help on this and report here (I have not used Python console my self, but my colleague can help)!
    – Sanna Jokela
    Dec 12 at 14:01















Thank you @caryhutchinson, we shall see if there is some help on this and report here (I have not used Python console my self, but my colleague can help)!
– Sanna Jokela
Dec 12 at 14:01




Thank you @caryhutchinson, we shall see if there is some help on this and report here (I have not used Python console my self, but my colleague can help)!
– Sanna Jokela
Dec 12 at 14:01

















draft saved

draft discarded
















































Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f305804%2fallowing-all-qgis-workspace-layers-to-be-editable-at-once%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?