Re: [Qgis-developer] What about a qgis project add function ?
Il 01/03/2014 22:07, Régis Haubourg ha scritto: I would love to call it Add or embed from other project, and just add a checkbox choose embed or hard copy of the layers and groups. Existing dialog is already correct. I just ported Import Project plugin to 2.0 to satisfy that need. Just be aware that you need to give a new id to imported layers, to be able to import some layers n times. Code is quite simple, I would love to see that in core! +1 Merci Régis. -- Paolo Cavallini - www.faunalia.eu QGIS PostGIS courses: http://www.faunalia.eu/training.html ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] What about a qgis project add function ?
Am 02.03.2014 07:21, schrieb Geo DrinX: Hi Regis, do you intend this : ImportProject is a plugin that lets you load layers from another project file. Just select a project (.qgs) file, check off the layers you wish to load, and it will include them in your current project with all styling. Works with vector, raster, database and web service layers. Unfortunately, it throws error messages for me: Traceback (most recent call last): File C:/Users/Joost/.qgis2/python/plugins\importLayersFromProject\main.py, line 65, in run window.populateTable(filePath) File C:/Users/Joost/.qgis2/python/plugins\importLayersFromProject\LayerDialog.py, line 31, in populateTable info = getMapInfo(maps.item(i)) File C:/Users/Joost/.qgis2/python/plugins\importLayersFromProject\LayerDialog.py, line 85, in getMapInfo return {'name':name,'ds':ds,'mtype':mtype,'geom':geom,'provider':provider} UnboundLocalError: local variable 'geom' referenced before assignment Adding a project with absolute paths and without tile layers works, so I suggest to catch these cases before the error message occurs. The plugin Homepage is a little odd: http://plugins.qgis.org/plugins/importLayersFromProject/ calls this bug tracker page: http://hub.qgis.org/projects/ImportLayersFromProject which does not exist. From the plugin page inside QGIS, these pages are not accessible either. I think you messed up with import and Import. Greetings, André Joost ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] What about a qgis project add function ?
Hi, If you just want to embed layers or groups from other projects - this functionality already exists in core. Embedded layers are read-only (which is good in some situations, but bad in others). For situations where you want to change the layers, you can use the ImportProject plugin as already mentioned. At this stage the layer would be an independent layer not linked to the project imported from anymore. Embedded layers that are still linked have to be read-only, otherwise they have to be copies. Andreas Am 02.03.2014 08:27, schrieb Paolo Cavallini: Il 01/03/2014 22:07, Régis Haubourg ha scritto: I would love to call it Add or embed from other project, and just add a checkbox choose embed or hard copy of the layers and groups. Existing dialog is already correct. I just ported Import Project plugin to 2.0 to satisfy that need. Just be aware that you need to give a new id to imported layers, to be able to import some layers n times. Code is quite simple, I would love to see that in core! +1 Merci Régis. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] What about a qgis project add function ?
I suggest a slightly different approach (which may not be all that different once the details are worked out?) A project stores lots of info about more items than just a layer... but I often want to add a layer with the same style, actions, label, etc settings to several projects, or just to the current canvas without changing what is already in the canvas. Does it seem useful to others to be able to store such info in a layer setup file rather than a QGIS project file, so layers can be opened with all such info attached optionally read on opening? Regards, Brent Wood From: Paolo Cavallini cavall...@faunalia.it To: qgis-developer@lists.osgeo.org Sent: Sunday, March 2, 2014 9:27 PM Subject: Re: [Qgis-developer] What about a qgis project add function ? Il 01/03/2014 22:07, Régis Haubourg ha scritto: I would love to call it Add or embed from other project, and just add a checkbox choose embed or hard copy of the layers and groups. Existing dialog is already correct. I just ported Import Project plugin to 2.0 to satisfy that need. Just be aware that you need to give a new id to imported layers, to be able to import some layers n times. Code is quite simple, I would love to see that in core! +1 Merci Régis. -- Paolo Cavallini - www.faunalia.eu QGIS PostGIS courses: http://www.faunalia.eu/training.html ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] What about a qgis project add function ?
Brent, Perhaps I have misunderstood your question, but I think you can achieve this simply by save style as default . Every time you will use the layer in any QGIS project, the default style (which mean the default properties of the layer) would be applied. Michael 2014-03-02 18:27 GMT+01:00 Brent Wood pcr...@pcreso.com: I suggest a slightly different approach (which may not be all that different once the details are worked out?) A project stores lots of info about more items than just a layer... but I often want to add a layer with the same style, actions, label, etc settings to several projects, or just to the current canvas without changing what is already in the canvas. Does it seem useful to others to be able to store such info in a layer setup file rather than a QGIS project file, so layers can be opened with all such info attached optionally read on opening? Regards, Brent Wood -- *From:* Paolo Cavallini cavall...@faunalia.it *To:* qgis-developer@lists.osgeo.org *Sent:* Sunday, March 2, 2014 9:27 PM *Subject:* Re: [Qgis-developer] What about a qgis project add function ? Il 01/03/2014 22:07, Régis Haubourg ha scritto: I would love to call it Add or embed from other project, and just add a checkbox choose embed or hard copy of the layers and groups. Existing dialog is already correct. I just ported Import Project plugin to 2.0 to satisfy that need. Just be aware that you need to give a new id to imported layers, to be able to import some layers n times. Code is quite simple, I would love to see that in core! +1 Merci Régis. -- Paolo Cavallini - www.faunalia.eu QGIS PostGIS courses: http://www.faunalia.eu/training.html ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] What about a qgis project add function ?
Hi Michael, That is very close... (but does have a bug- #9687 - I can save a style, then try to load it for the same layer opened a second time get an error: error occurred while parsing reference at line 113 column 155) The line in the QML file is the action, which is appended tolabeling/shapeFillColorB as well as an action later in the file. property key=labeling/shapeFillColorB value=255/eom https://atlas.niwa.co.nz/login/SearchService?SERVICE_REQUEST_TYPE=100SERVICE_REQUEST_USERID=833SERVICE_REQUEST_ASSETID=[% atlas_id %]SERVICE_REQUEST_PASSKEY=public (Change the Atlas_ID value to 247002 or 247224 open the URL in a browser to see the result if you are interested - it is for a map layer of echosounder transects to retrieve the echogram from our image management tool via a web service) Anyway, apart from the bug, as I understand it, that allows me to save a style, which can then be applied to a layer, but does not inlude the layer data source. I'd like to be able to open a layer (sort of like a virtual dataset in ogr) by opening the QGIS layer file, have the layer load all settings applied automatically. Currently I need to open a layer, open properties, select style, load style, apply style every time I load the layer. Cheers, Brent From: kimaidou kimai...@gmail.com To: Brent Wood pcr...@pcreso.com Cc: qgis-developer@lists.osgeo.org qgis-developer@lists.osgeo.org Sent: Monday, March 3, 2014 6:40 AM Subject: Re: [Qgis-developer] What about a qgis project add function ? Brent, Perhaps I have misunderstood your question, but I think you can achieve this simply by save style as default . Every time you will use the layer in any QGIS project, the default style (which mean the default properties of the layer) would be applied. Michael 2014-03-02 18:27 GMT+01:00 Brent Wood pcr...@pcreso.com: I suggest a slightly different approach (which may not be all that different once the details are worked out?) A project stores lots of info about more items than just a layer... but I often want to add a layer with the same style, actions, label, etc settings to several projects, or just to the current canvas without changing what is already in the canvas. Does it seem useful to others to be able to store such info in a layer setup file rather than a QGIS project file, so layers can be opened with all such info attached optionally read on opening? Regards, Brent Wood From: Paolo Cavallini cavall...@faunalia.it To: qgis-developer@lists.osgeo.org Sent: Sunday, March 2, 2014 9:27 PM Subject: Re: [Qgis-developer] What about a qgis project add function ? Il 01/03/2014 22:07, Régis Haubourg ha scritto: I would love to call it Add or embed from other project, and just add a checkbox choose embed or hard copy of the layers and groups. Existing dialog is already correct. I just ported Import Project plugin to 2.0 to satisfy that need. Just be aware that you need to give a new id to imported layers, to be able to import some layers n times. Code is quite simple, I would love to see that in core! +1 Merci Régis. -- Paolo Cavallini - www.faunalia.eu QGIS PostGIS courses: http://www.faunalia.eu/training.html ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] What about a qgis project add function ?
Andre Joost wrote Am 02.03.2014 07:21, schrieb Geo DrinX: Hi Regis, do you intend this : ImportProject is a plugin that lets you load layers from another project file. Just select a project (.qgs) file, check off the layers you wish to load, and it will include them in your current project with all styling. Works with vector, raster, database and web service layers. Unfortunately, it throws error messages for me: Traceback (most recent call last): File C:/Users/Joost/.qgis2/python/plugins\importLayersFromProject\main.py, line 65, in run window.populateTable(filePath) File C:/Users/Joost/.qgis2/python/plugins\importLayersFromProject\LayerDialog.py, line 31, in populateTable info = getMapInfo(maps.item(i)) File C:/Users/Joost/.qgis2/python/plugins\importLayersFromProject\LayerDialog.py, line 85, in getMapInfo return {'name':name,'ds':ds,'mtype':mtype,'geom':geom,'provider':provider} UnboundLocalError: local variable 'geom' referenced before assignment Adding a project with absolute paths and without tile layers works, so I suggest to catch these cases before the error message occurs. The plugin Homepage is a little odd: lt;http://plugins.qgis.org/plugins/importLayersFromProject/gt; calls this bug tracker page: lt;http://hub.qgis.org/projects/ImportLayersFromProjectgt; which does not exist. From the plugin page inside QGIS, these pages are not accessible either. I think you messed up with import and Import. Greetings, André Joost ___ Qgis-developer mailing list Qgis-developer@.osgeo http://lists.osgeo.org/mailman/listinfo/qgis-developer Thanks André, I will have a look at it, I just ported the plugin to 2.0 after having asked the permission from Barry, but I admit I did very little tests! Geo DrinX, can you tell me if you're going to work on that? I'm planning my budgets for the on-going year, and I have that on my list (low priority). I would fund the checkbox in embed layer dialog, and maybe an option in open project dialog to ask for opening as new or append to current project. Opinions on that second option? I'm experimenting it in a French plugin (create menu), and I must say it's quite convenient to add the whole project, and drop the layers I don't need. This is pure ergonomy, maybe we should discuss it in UX list -- View this message in context: http://osgeo-org.1560.x6.nabble.com/What-about-a-qgis-project-add-function-tp5106777p5106975.html Sent from the Quantum GIS - Developer mailing list archive at Nabble.com. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] What about a qgis project add function ?
Hi, In fact, what would be great is a small evolution of Embed Group and layers actions. I would love to call it Add or embed from other project, and just add a checkbox choose embed or hard copy of the layers and groups. Existing dialog is already correct. I just ported Import Project plugin to 2.0 to satisfy that need. Just be aware that you need to give a new id to imported layers, to be able to import some layers n times. Code is quite simple, I would love to see that in core! Régis -- View this message in context: http://osgeo-org.1560.x6.nabble.com/What-about-a-qgis-project-add-function-tp5106777p5106860.html Sent from the Quantum GIS - Developer mailing list archive at Nabble.com. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] What about a qgis project add function ?
Hi Regis, do you intend this : ImportProject is a plugin that lets you load layers from another project file. Just select a project (.qgs) file, check off the layers you wish to load, and it will include them in your current project with all styling. Works with vector, raster, database and web service layers. Barry barry.rowling...@gmail.com ? I have a note : in the Info panel, you have CopyPasta in the title :) And , you have right : it should be insert under the Project menu, and not only between Plugins :) BTW, Great !!! Roberto 2014-03-01 22:07 GMT+01:00 Régis Haubourg regis.haubo...@eau-adour-garonne.fr: Hi, In fact, what would be great is a small evolution of Embed Group and layers actions. I would love to call it Add or embed from other project, and just add a checkbox choose embed or hard copy of the layers and groups. Existing dialog is already correct. I just ported Import Project plugin to 2.0 to satisfy that need. Just be aware that you need to give a new id to imported layers, to be able to import some layers n times. Code is quite simple, I would love to see that in core! Régis -- View this message in context: http://osgeo-org.1560.x6.nabble.com/What-about-a-qgis-project-add-function-tp5106777p5106860.html Sent from the Quantum GIS - Developer mailing list archive at Nabble.com. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer