Allowing all QGIS workspace layers to be editable at once
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.
qgis layers editing
add a comment |
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.
qgis layers editing
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 '18 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 '18 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 '18 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 '18 at 12:52
add a comment |
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.
qgis layers editing
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.
qgis layers editing
qgis layers editing
edited Dec 12 '18 at 15:14
Andy
1,239714
1,239714
asked Dec 12 '18 at 9:57
Sanna JokelaSanna 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 '18 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 '18 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 '18 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 '18 at 12:52
add a comment |
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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 at 12:52
add a comment |
2 Answers
2
active
oldest
votes
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()
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 '18 at 14:50
add a comment |
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.
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.
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 '18 at 14:01
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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()
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 '18 at 14:50
add a comment |
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()
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 '18 at 14:50
add a comment |
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()
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()
edited Dec 12 '18 at 14:55
answered Dec 12 '18 at 14:40
OrienteerixOrienteerix
393211
393211
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 '18 at 14:50
add a comment |
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 '18 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 '18 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 '18 at 14:50
add a comment |
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.
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.
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 '18 at 14:01
add a comment |
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.
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.
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 '18 at 14:01
add a comment |
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.
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.
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.
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.
answered Dec 12 '18 at 13:42
Cary HCary H
1409
1409
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 '18 at 14:01
add a comment |
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 '18 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 '18 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 '18 at 14:01
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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 '18 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 '18 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 '18 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 '18 at 12:52