Re: [QGIS-Developer] "Actions" menu in feature forms
if you set an action in layer properties you will find into the action menu Il Gio 17 Mag 2018, 6:43 PM Alessandro Pasottiha scritto: > In current master there is an empty "Actions" menu in the forms. > > What is it? > > -- > Alessandro Pasotti > w3: www.itopen.it > ___ > QGIS-Developer mailing list > QGIS-Developer@lists.osgeo.org > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] problem with ON INSERT TO ... DO INSTEAD postgres rules
I resolve the problem by adding the RETURNING clause in the INSERT RULES fololwed by all single field name and with a dummy value where I can't returning the real value, eg: REATE OR REPLACE RULE insert_generalita AS ON INSERT TO sifrap.v_frane_pol_full DO INSTEAD INSERT INTO sifrap.iffi_pol (idfrana, tipopol, the_geom) VALUES (new.idfrana, new.tipopol, st_multi(new.the_geom)) RETURNING iffi_pol.gid, iffi_pol.idfrana, ''::text AS idesteso, 1::smallint tipopol, ''::CHARACTER VARYING tipo_poligono, 1::smallint tipo, [...]. It seem all works fine. Thanks for the tips ! Luca 2017-01-23 18:45 GMT+01:00 Luca Lanteri <lklant...@gmail.com>: > Hi Matthias, > > thanks for your answer. Sorry but I missed your previous mail. > Now I've seen that in your example you used TRIGGERS to update your data, > instead in my case I use view RULES. > I try to add "RETURNING new" clause in the rules but it doesn't work. > > I can try to change all my code and substitute RULES with TRIGGERS but I > still hope there is another way to maintain the possibility of using rules. > Is It possible that I'm just missing a simply solution because I don't > know well the using of RETURNING in postgres views? > > thanks > Luca > > > 2017-01-23 18:15 GMT+01:00 Matthias Kuhn <matth...@opengis.ch>: > >> Hi Luca, >> >> this was a deliberate change to allow QGIS to directly use the newly >> inserted features (e.g. add child records to a newly created feature). >> >> To make the views compatible with this, all you need to do is add a >> >> RETURN NEW; >> >> to the end of the insert function (I think). Have a look at the views >> which I linked in my response in the other thread. >> >> We could possibly add a flag to specify in which cases we need the new >> primary key and in which cases not. >> But I somehow suspect, that in the end we will need to specify this in >> some often-used code (e.g. add feature form) and in the end one will >> still be required to update all views and we have some half-baked >> pointless workaround code inside QGIS. >> >> Hope that helps for you! >> Matthias >> >> On 01/23/2017 04:19 PM, Luca Lanteri wrote: >> > Hi to all, >> > >> > after a short disscussion in qgis user list I've opened this ticket [0], >> > because starting from QGIS 2.16 I can't insert new feature in postgres >> > views using rules. When I try to insert a new feature I have this error >> > [1]. All works fine with QGIS 2.14. The problem happens only with INSERT >> > rules. UPDATE and DELETE are ok. >> > >> > I saw that for simple rules I can add a RETURNING * clause and all works >> > fine, but I have a lot of complex view that use many tables, so >> > RETURNING * clause doesn't work and compose the clause it's really hard. >> > >> > Then I have some question: >> > 1) Is it really an issue or the problem is due to a new functionality of >> > QGIS ? >> > 2) In the first case, it could be considered a regression for it works >> > on QGIS 2.14 ? >> > 3) Is there a simple way to modify my views by adding a RETURNING clause >> > without specify all returning field (* doesn't work) ? >> > >> > I love to know if it's a deliberate change or it's just a bug,so I can >> > choose if I have to modify all my views, in order to allow me to migrate >> > to QGIS 2.18. >> > >> > Many thanks in advance >> > Regards >> > Luca >> > >> > >> > [0] https://hub.qgis.org/issues/16083 >> > >> > [1] Impossibile applicare le modifiche al vettore v_frane_pol_full >> > >> > Errori: ERRORE: 1 geometria non aggiunta. >> > Errori della sorgente dati: >> > Errore PostGIS nell'aggiunta delle geometrie: ERROR: cannot perform >> > INSERT RETURNING on relation "v_frane_pol_full" >> > >> > HINT: You need an unconditional ON INSERT DO INSTEAD rule with a >> > RETURNING clause. >> > >> > >> > >> > ___ >> > Qgis-developer mailing list >> > Qgis-developer@lists.osgeo.org >> > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer >> > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer >> > >> ___ >> Qgis-developer mailing list >> Qgis-developer@lists.osgeo.org >> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer >> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer > > > ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] problem with ON INSERT TO ... DO INSTEAD postgres rules
Hi Matthias, thanks for your answer. Sorry but I missed your previous mail. Now I've seen that in your example you used TRIGGERS to update your data, instead in my case I use view RULES. I try to add "RETURNING new" clause in the rules but it doesn't work. I can try to change all my code and substitute RULES with TRIGGERS but I still hope there is another way to maintain the possibility of using rules. Is It possible that I'm just missing a simply solution because I don't know well the using of RETURNING in postgres views? thanks Luca 2017-01-23 18:15 GMT+01:00 Matthias Kuhn <matth...@opengis.ch>: > Hi Luca, > > this was a deliberate change to allow QGIS to directly use the newly > inserted features (e.g. add child records to a newly created feature). > > To make the views compatible with this, all you need to do is add a > > RETURN NEW; > > to the end of the insert function (I think). Have a look at the views > which I linked in my response in the other thread. > > We could possibly add a flag to specify in which cases we need the new > primary key and in which cases not. > But I somehow suspect, that in the end we will need to specify this in > some often-used code (e.g. add feature form) and in the end one will > still be required to update all views and we have some half-baked > pointless workaround code inside QGIS. > > Hope that helps for you! > Matthias > > On 01/23/2017 04:19 PM, Luca Lanteri wrote: > > Hi to all, > > > > after a short disscussion in qgis user list I've opened this ticket [0], > > because starting from QGIS 2.16 I can't insert new feature in postgres > > views using rules. When I try to insert a new feature I have this error > > [1]. All works fine with QGIS 2.14. The problem happens only with INSERT > > rules. UPDATE and DELETE are ok. > > > > I saw that for simple rules I can add a RETURNING * clause and all works > > fine, but I have a lot of complex view that use many tables, so > > RETURNING * clause doesn't work and compose the clause it's really hard. > > > > Then I have some question: > > 1) Is it really an issue or the problem is due to a new functionality of > > QGIS ? > > 2) In the first case, it could be considered a regression for it works > > on QGIS 2.14 ? > > 3) Is there a simple way to modify my views by adding a RETURNING clause > > without specify all returning field (* doesn't work) ? > > > > I love to know if it's a deliberate change or it's just a bug,so I can > > choose if I have to modify all my views, in order to allow me to migrate > > to QGIS 2.18. > > > > Many thanks in advance > > Regards > > Luca > > > > > > [0] https://hub.qgis.org/issues/16083 > > > > [1] Impossibile applicare le modifiche al vettore v_frane_pol_full > > > > Errori: ERRORE: 1 geometria non aggiunta. > > Errori della sorgente dati: > > Errore PostGIS nell'aggiunta delle geometrie: ERROR: cannot perform > > INSERT RETURNING on relation "v_frane_pol_full" > > > > HINT: You need an unconditional ON INSERT DO INSTEAD rule with a > > RETURNING clause. > > > > > > > > ___ > > Qgis-developer mailing list > > Qgis-developer@lists.osgeo.org > > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer > > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer > > > ___ > Qgis-developer mailing list > Qgis-developer@lists.osgeo.org > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] problem with ON INSERT TO ... DO INSTEAD postgres rules
Hi to all, after a short disscussion in qgis user list I've opened this ticket [0], because starting from QGIS 2.16 I can't insert new feature in postgres views using rules. When I try to insert a new feature I have this error [1]. All works fine with QGIS 2.14. The problem happens only with INSERT rules. UPDATE and DELETE are ok. I saw that for simple rules I can add a RETURNING * clause and all works fine, but I have a lot of complex view that use many tables, so RETURNING * clause doesn't work and compose the clause it's really hard. Then I have some question: 1) Is it really an issue or the problem is due to a new functionality of QGIS ? 2) In the first case, it could be considered a regression for it works on QGIS 2.14 ? 3) Is there a simple way to modify my views by adding a RETURNING clause without specify all returning field (* doesn't work) ? I love to know if it's a deliberate change or it's just a bug,so I can choose if I have to modify all my views, in order to allow me to migrate to QGIS 2.18. Many thanks in advance Regards Luca [0] https://hub.qgis.org/issues/16083 [1] Impossibile applicare le modifiche al vettore v_frane_pol_full Errori: ERRORE: 1 geometria non aggiunta. Errori della sorgente dati: Errore PostGIS nell'aggiunta delle geometrie: ERROR: cannot perform INSERT RETURNING on relation "v_frane_pol_full" HINT: You need an unconditional ON INSERT DO INSTEAD rule with a RETURNING clause. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Warning - shapefile corruption on 2.16/master and how to recover
I've encountered the same problem when i try to split some polygons. I don't really understand what was the problem, just some hint: - it occours only on windows. The same shapefile works fine on Linux. - it also affects qgis 2.14 - is not connected with topology error. The problem remain also after using v.clean. I hope this could be useful Luca Il 16/Set/2016 03:08, "Nyall Dawson"ha scritto: > Unfortunately a fairly nasty regression has slipped in to 2.16 and is > still present on master. This results in shapefile corruption in > certain circumstances. > > While I've hit this issue maybe 3 or 4 times in the last 2 months, I > haven't been able to track down exactly what causes this. It seems > related to using the split or reshape tool on a shapefile, then saving > the changes and getting the errors "Cannot reopen datasource > xxx.shp|layerid=0 in read-only mode" and "Data source is invalid > (Unable to open xxx.shx or xxx.SHX.Try --config SHAPE_RESTORE_SHX true > to restore or create it)" in the log. > > A full report is at http://hub.qgis.org/issues/15570 > > Hopefully we can resolve this before the next round of releases. In > the meantime, there's a workaround for recovering data: > > In the same folder as the shapefile there'll be additional files > "xxx_packed.shp" and "xxx_packed.shx". Renaming the "xxx_packed.shx" > file to "xxx.shx" allows the original shapefile to be reopened. > > Nyall > ___ > Qgis-developer mailing list > Qgis-developer@lists.osgeo.org > List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] Fwd: qgis 2.12 problemi di snap
Hi, I noticed a strange behavior using snap feature with qis 2.12. I try to describe it: - Edit a layer with active snap on a second layer. - move polygon vertex. - sometimes new points are added to another polygon in the editing layer, sometimes where I move the vertex (as you can see in [0], sometimes far away from it, but in any case snapped with the second layer. I haven't yet find the complete sequence to reproduce the error, so I attach a video [0] to describe the problem. Do you know if it's a known issue or can anyone confirm it ? If confirmed it could be a very insidious issue, because it can damage the layer. I tested it on 2.12 and 2.13 (and with less accuracy on 2.8) 64bit on linux mint 17.3. Thanks Luca [0] https://drive.google.com/open?id=0B1XiZk5sA7aIVW9MSjhwb04xWjg ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] [Qgis-user] QGIS - value relation widget
Sadly, after further test I discover that the crashes remain, so I think it is a qgis bug and not a problem in my code. The problem happens when I put my custom form into a subform widget (QgsRelationEditorWidget). If I add a new record in the subform and I move to another record using the left column QGIS crashes. It seems to be a more general problem because the crash appears also when I add some simple control that modify the object in the form. I can open a ticket and add some test data. If it is a minor bug and it could be resolved easily I really offer a pizza and a beer to resolve it. All the best Luca 2015-10-01 23:53 GMT+02:00 Luca Lanteri <mesca...@gmail.com>: > Hi, > > now I'm already using the python logic but my code is terrible and I have > a lot of crash problem. > Now that I using your example all is easier and seem to worsk fine. > > I owe you one beer. > Many many tanks ! > > Luca > > > 2015-10-01 22:23 GMT+02:00 Blumentrath, Stefan <stefan.blumentr...@nina.no > >: > >> Hi Luca, >> >> >> >> Sounds like a case for Python logic! >> >> General principles are explained here: >> >> >> http://nathanw.net/2011/09/05/qgis-tips-custom-feature-forms-with-python-logic/ >> >> >> >> Also nice, and probably exactly what you are looking for: >> >> http://medspx.fr/blog/Qgis/cascade_forms/ >> >> >> >> Cheers >> >> Stefan >> >> >> >> *From:* qgis-user-boun...@lists.osgeo.org [mailto: >> qgis-user-boun...@lists.osgeo.org] *On Behalf Of *Luca Lanteri >> *Sent:* 1. oktober 2015 22:07 >> *To:* qgis-user <qgis-u...@lists.osgeo.org> >> *Subject:* [Qgis-user] QGIS - value relation widget >> >> >> >> Hi to all, >> >> I need to build a form when the value of a combo are filtered basing on >> the value of anoter combobox. >> I have a first combo where I choose the region and a second with the >> municipalities. >> I need that the second combo shows only the municipalities of the choosed >> region. >> I tried to use use the widget "relationship value" with the a filter like >> classe_munic = attribute($currentfeature, 'classe_munic') without any >> success. >> >> Has anyone ever done something similar? >> Thank in advance >> >> >> Luca >> > > ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] QGSrelationeditorwidget in custom form
Hi, I'm using the QGSrelationeditorwidget in a custom form with qtcreator. It works very well (very powerful feature !) but I have some problem: The first is that I can't fit my subform due to the large amount of data present inside of it. I wondering if it were possible to set the width of the leftmost column (where there is the selection of the related record) because it is huge and it use the main part of my form. I try to see in the properties of the widget but unsuccessfully. The second problem is that I can't activate my custom objects into the subform when I switch to editing mode because I can't find the proper signal. Is there a signal for QGSrelationeditorwidget that say to me when the subform goes in editing mode ? Thank in advance Luca ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] add toogle editing into custom form
Hi, excuse me for the very very newby question. I want to add a button in my custom form in order to toogle the editing status of a layer. I try to navigate the qgis api but I can't understand the way to stop editing and save/reject modify. I try to insert a code like this [0] (obviously the else part doesn't fit my request, it's just a pleaceholder to try my code). [0] def toggleEdit(): aLayer = QgsMapLayerRegistry.instance().mapLayersByName('layer')[0] if not aLayer.isEditable(): aLayer.startEditing() else: aLayer.rollBack(True) any hint ? thanks in advance Luca ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] [Qgis-user] Poor performance with large projects
I can confirm this issue. I've the same problem when work with my complex projects. I'm not a developer so I can't propose a solution but I'm available for testing. Luca 2015-02-06 9:52 GMT+01:00 Sam Ingarfield sjfingarfi...@gmail.com: Hi Everyone, I have been suffering from *very* poor performance on a number of projects, which only seems to become noticeable on large, complex projects. I have filed a bug with regards to this, see http://hub.qgis.org/issues/12125. Giovanni suggested I cross-post on the developer and user lists to see if others are experiencing the problem/have any ideas on what's going on. The issue I am experiencing manifests in two ways: a) Very slow project loading times (30mins at times). Someone on the bug tracker suggested that this may in part be related to the retrieval of extent and geometry from postgis layers. I've had a look at the debugging logs (from the master build) and this seems to be the case, for what I estimate as about half the loading time. b) Very slow addition and removal of layers after the first save event. From a quick look at the debug output, it seems that after the first save, the entire project is being reloaded on each layer addition/removal, which takes a very long time. Before the first save event, performance is very good, addition and removal of layers is virtually instantaneous. Obviously long project times are annoying but manageable, so long as I only have to load the project infrequently. The second issue, however, makes Qgis pretty much unworkable and leads to very long times between saves (and the inevitable quit reload to restore performance) which is poor practice. To give you an idea of the difference between pre and post-save behaviour, Qgis emits about 850 lines of debugging output pre-save, rising to over 430,000 lines post-save when adding a layer to one of my projects. Am happy to share debugging output with a developer off-list if that would help nail down what is happening and could lead to a fix. Cheers; Sam Ingarfield. ___ Qgis-user mailing list qgis-u...@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] python code in form
Hi Matthias, this is exactly what I need! many thanks Luca 2015-01-06 11:59 GMT+01:00 Matthias Kuhn matth...@opengis.ch: Hi Luca, There was a *DEBUGMODE* attribute introduced some time ago, that can be set on the python form module. If it is set to True, the changes should be reloaded automatically when you reopen the form. Matthias ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] python code in form
Hi Bernard, thanks for the tip. I've seen DataDrivenInputMask some time ago and I promised myself to deepen it because I use lots of data stored postgres and this plugin seems very useful. However the main limitations for this very project are that I must use custom forms (to insert the project logo and more stuff) and it also should work with spatialite. thanks Luca 2015-01-05 10:02 GMT+01:00 Bernhard Ströbl bernhard.stro...@jena.de: Hi Luca, this is a bit off topic but when you store your data in PostgreSQL you might want to try out the DataDrivenInputMask plugin [1] which has a lot of (database) intelligence in the form and can be customized to hold even more. Maybe you do not need to customize QGIS' forms any more. Bernhard [1] http://plugins.qgis.org/plugins/DataDrivenInputMask/ Am 04.01.2015 22:39, schrieb Luca Lanteri: Hi, I'm using the init python function in order to add python code into my QGIS forms. This is a great function because I can add intelligence to my form without write a plugin, but I still have some problems: - I want to store qml and .ui file directly into Postgres so that when my users load a layer from postrgres they've my forms and styles, without pass to us a qgis project, but in this way I loose the python code. Is there a way to store also the python code in postgres or into qml? - when I change my python code, qgis can't auto reload it. I have to save the file with a different name and I have to change the name in the layer properties. Is there a way to force autoreload of the code, also only for debugging? I also thought to move my code in a plugin to bypass those problems but I think I've to rewrite all useful function that come with the forms properties, eg: the combo population. is It right or there's a way to include the QGIS forms add-on into a plugin? Sorry for my newbie's question and thanks in advance. Luca __ Information from ESET Mail Security, version of virus signature database 10965 (20150105) __ The message was checked by ESET Mail Security. http://www.eset.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
[Qgis-developer] python code in form
Hi, I'm using the init python function in order to add python code into my QGIS forms. This is a great function because I can add intelligence to my form without write a plugin, but I still have some problems: - I want to store qml and .ui file directly into Postgres so that when my users load a layer from postrgres they've my forms and styles, without pass to us a qgis project, but in this way I loose the python code. Is there a way to store also the python code in postgres or into qml? - when I change my python code, qgis can't auto reload it. I have to save the file with a different name and I have to change the name in the layer properties. Is there a way to force autoreload of the code, also only for debugging? I also thought to move my code in a plugin to bypass those problems but I think I've to rewrite all useful function that come with the forms properties, eg: the combo population. is It right or there's a way to include the QGIS forms add-on into a plugin? Sorry for my newbie's question and thanks in advance. Luca ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] feature cloned when using python init function in forms
Thanks Matthias, I search in the bug tracker some days ago and I didn't find this bug. I'm too slow to send my issues, or others Qgis users are too fast ! ;-) regards 2014-07-22 8:20 GMT+02:00 Matthias Kuhn matthias.k...@gmx.ch: Hi Luca, there is an issue report open for this [1] Kind regards, Matthias [1] http://hub.qgis.org/issues/10862 On Mon 21 Jul 2014 11:07:59 PM CEST, Luca Lanteri wrote: Hi to all, moving to qgis 2.4 I noticed a strange behaviour: if I define a python init function for a form in Layer properties - Field menu every time that I insert a new feature this is inserted twice. Anyone can confirm this behaviour ? It's a new bug of the 2.4 ? If I use qgis 2.0 all works fine. Thank in advance Luca ___ 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] feature cloned when using python init function in forms
Hi to all, moving to qgis 2.4 I noticed a strange behaviour: if I define a python init function for a form in Layer properties - Field menu every time that I insert a new feature this is inserted twice. Anyone can confirm this behaviour ? It's a new bug of the 2.4 ? If I use qgis 2.0 all works fine. Thank in advance Luca ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] master slow reading rasters?
I had the same problem on a old version od qgis using large raster with rotation parameter into the tfw file. May be the same issue? Il 21/mar/2014 09:30 Paolo Cavallini cavall...@faunalia.it ha scritto: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Il 20/03/2014 18:28, Giovanni Manghi ha scritto: yes, apparently it depends on the size of the raster (I'm trying with pretty large ones) how much large? I'm testing with 9gb rasters and it is lighting fast (just fast wothout overviews). 3Gb Perhaps this has something to do with colour table? - -- Paolo Cavallini - www.faunalia.eu Corsi QGIS e PostGIS: http://www.faunalia.eu/training.html -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iEYEARECAAYFAlMr+IsACgkQ/NedwLUzIr7SQwCeIghnSuiLMtNInJv1lZ62h8w6 KscAoKRHNpAaxkldKqxMd/hKmT5pp3Aj =Nxoj -END PGP SIGNATURE- ___ 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] point displacement style
Hi to all, I'm using the point diplacement style. I noticed that it doesn't use the new label engine for labelling the diplaced simbol, so the collision engine doesnt' work. There's in plain to migrate it to the new label engine? It could be useful if I open a ticket ? I also have some visualization problem, because at some scale the point displaced symbols disappear (tested on qgis 2.10 Master - Ubuntu 13.04-64bit). Anyone can confirm this problem ? Thanks in advance Luca ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] point displacement style
Hi Andreas, thanks for your prompt reply ! I start to use this useful function for a project ant it resolve to me a lot of problem. 2014-01-31 Andreas Neumann a.neum...@carto.net: Hi Luca, I can't help with the labeling. At the time the point displacement renderer was developed (about 5 years ago), the labeling engine wasn't as advanced as it is today. So it wasn't an option and also not necessary to the project. I would not regard this as a bug request, but as a feature request and I guess it would a substantial bit of work to integrate the new labeling engine with the point displacement renderer. Ok, I thought that it was due to this problem. I can open a request feature ticket, just to keep track of it. Do you have an idea how it should behave? I guess, depending on how many points there are there isn't a solution to perfectly label all points. I have at least 4-5 point in the circle. My points stay in a layer, geographically linked with another point layer (all point have the same coord) that contain only 1 point. I have 2 kind of problem: - the first one is when I have just 1 point in the first layer, so the point is not drawn in a circle and the two layer are overlapping. On kind solution is to allow to displace point in a circle also when there is just one point in a place. - the second one is when I have more than 1 point and the label of the displaced point overlapping with the second layer label. - The point displacement renderer could also be improved to display points in a cluster, not just around the circle, but also inside the circle. This would be more complex to implement, but it would save map/screen space and would visually more pleasing. If you have funds available - please consider hiring a developer. I can try to put this requests in my next commitment to qgis developers. - Regarding the second issue: this may be a bug. Or in extreme cases - if you have many points at a single location - the circle could be so big that it is rendered outside of the visible rendered map area. I am also a user of the point-displacement renderer - so I would like to see improvments in this feature! I noticed this bug also with 2 point and a small circle. I can investigate deeper and try it also with 2.0 qgis version. Thank you for bringing this up. Thanks to you Andreas Luca ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] Open custom form from another form
Hi to all, I need a help from a python guru. I'm trying to move my first steps with pyqgis. I've got two qgis layer with a 1 to many relation. I create a custom form for the parent layer with a QTableWidget that contain the primary key of the child layer. Now I want to open another custom form with the data of the child record selected into the QTableWidget. I try to look up into the QGIS API Documentation but I'didn't find the solution to my problem. Now I just can open form with this code, connected with a button: path = os.path.dirname( os.path.abspath( __file__ ) ) uifile = os.path.join(path , my_form.ui') window = uic.loadUi(uifile) window.exec_() how can I connect my form with the right data ? Can I use some method to select the right layer/record and open it in the form ? Thanks in advance for any tips Luca ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Open custom form from another form
Hi denis, thanks a lot for the tip,I'll try it immediately. I know the brand new 1 to many feature present in qgis 2.1 and it's gorgeous, but as I know it works only with autogenerate forms, but I need to use a custom forn because I have some code into it. many thanks Luca 2014/1/14 Denis Rouzaud denis.rouz...@gmail.com Hi Luca, The best way to do this, is to set your personnally designed UI file in the layer properties-field properties-attribute editor layout-provide ui file Then, you want to call qgis method to show a feature form: http://qgis.org/api/classQgisInterface.html#aff2467aa3cefd8fc5b59213f385b7180 And you would need some processing to show it: 1. get feature id from the selected line 2. fetch the feature of the main layer 3. get the foreign key from one of its fields 4. fetch the corresponding feature 4. show the feature form with it Anyway, if I understand properly, you're trying to do something which has been recently added to QGIS (it's in the master version), it's 1:n relations. See here for more info: http://blog.vitu.ch/10112013-1201/qgis-relations Cheers, Denis On 14. 01. 14 16:50, Luca Lanteri wrote: Hi to all, I need a help from a python guru. I'm trying to move my first steps with pyqgis. I've got two qgis layer with a 1 to many relation. I create a custom form for the parent layer with a QTableWidget that contain the primary key of the child layer. Now I want to open another custom form with the data of the child record selected into the QTableWidget. I try to look up into the QGIS API Documentation but I'didn't find the solution to my problem. Now I just can open form with this code, connected with a button: path = os.path.dirname( os.path.abspath( __file__ ) ) uifile = os.path.join(path , my_form.ui') window = uic.loadUi(uifile) window.exec_() how can I connect my form with the right data ? Can I use some method to select the right layer/record and open it in the form ? Thanks in advance for any tips Luca ___ Qgis-developer mailing listQgis-developer@lists.osgeo.orghttp://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] Open custom form from another form
yeah ! IMHO the 1 to many feature is one of the best improvement of the 2.1 qgis version. It solve to me a lot of work's problem. Qgis Rulez! I tried your tips and now all works fine. Usually the problem for me is moving into API class reference. I need to study it deeply. Thanks a lot Luca 2014/1/14 Denis Rouzaud denis.rouz...@gmail.com Hi Luca, Since two months, it does support custom ui form [0] You have to place a widget in your form and a dynamic property to the widget. You call it qgisRelation and set it to the id of the relation. Cheers, Denis [0] https://github.com/qgis/QGIS/commit/08b43aadd19414d267f86082f7d865f3abc179d1 On 14. 01. 14 17:09, Luca Lanteri wrote: Hi denis, thanks a lot for the tip,I'll try it immediately. I know the brand new 1 to many feature present in qgis 2.1 and it's gorgeous, but as I know it works only with autogenerate forms, but I need to use a custom forn because I have some code into it. many thanks Luca 2014/1/14 Denis Rouzaud denis.rouz...@gmail.com Hi Luca, The best way to do this, is to set your personnally designed UI file in the layer properties-field properties-attribute editor layout-provide ui file Then, you want to call qgis method to show a feature form: http://qgis.org/api/classQgisInterface.html#aff2467aa3cefd8fc5b59213f385b7180 And you would need some processing to show it: 1. get feature id from the selected line 2. fetch the feature of the main layer 3. get the foreign key from one of its fields 4. fetch the corresponding feature 4. show the feature form with it Anyway, if I understand properly, you're trying to do something which has been recently added to QGIS (it's in the master version), it's 1:n relations. See here for more info: http://blog.vitu.ch/10112013-1201/qgis-relations Cheers, Denis On 14. 01. 14 16:50, Luca Lanteri wrote: Hi to all, I need a help from a python guru. I'm trying to move my first steps with pyqgis. I've got two qgis layer with a 1 to many relation. I create a custom form for the parent layer with a QTableWidget that contain the primary key of the child layer. Now I want to open another custom form with the data of the child record selected into the QTableWidget. I try to look up into the QGIS API Documentation but I'didn't find the solution to my problem. Now I just can open form with this code, connected with a button: path = os.path.dirname( os.path.abspath( __file__ ) ) uifile = os.path.join(path , my_form.ui') window = uic.loadUi(uifile) window.exec_() how can I connect my form with the right data ? Can I use some method to select the right layer/record and open it in the form ? Thanks in advance for any tips Luca ___ Qgis-developer mailing listQgis-developer@lists.osgeo.orghttp://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] problem with forms and python init
Hi Enzo, I return to this old discussion because I noticed that the problem that I described still remain the same when I use Qgis 2.0. On the contrary when I use Qgis 2.1 all works fine. I didn't full understand this problem previously because I use qgis 2.0 on my works PC and and 2.1 with linux on my laptop. Anyway I resolve the problem whit Qgis 2.0 using your tip of QgsFeatureRequest with NoGeometry flag, so the mail is just to keep track of the problem. thanks again. Luca 2013/12/21 Luca Lanteri mesca...@gmail.com you are right, the code now works fine. It was just my fault due to to the fact that I'm trying to take ones first steps with pygis ! thanks for the support and sorry for the noise. Btw I also resolve my second problem described in the first mail. thanks Luca 2013/12/21 Enzo Ciarmoli enzo.ciarm...@csi.it: nevertheless the problem remain the same: if i try to load the data from a table without geometry, values for i.attributes()[1] remain empty. Hi Luca, I tried your sample code and it works... I don't know what's wrong in your situation... If your problem remain the same, I could suggest you to use QgsFeatureRequest with NoGeometry flag (see Detailed Description in: http://www.qgis.org/api/classQgsFeatureRequest.html ) Example: layer = QgsMapLayerRegistry.instance().mapLayersByName('your_table')[0] iter = layer.getFeatures(QgsFeatureRequest().setFlags(QgsFeatureRequest.NoGeometry)) for feat in iter: print feat.attributes() print feat.attributes()[0] print feat.attributes()[1] Ciao! Enzo ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] problem with forms and python init function
Thanks Nathan, your code is decisively more clearer ! nevertheless the problem remain the same: if i try to load the data from a table without geometry, values for i.attributes()[1] remain empty. Luca 2013/12/20 Nathan Woodrow madman...@gmail.com: Hey Luca, If all you want to do is load the attributes for a column from layer you can just do this: layer = QgsMapLayerRegistry.instance().mapLayersByName('yourname')[0] for feature in layer.getFeatures(): combo.addItem(feature['columnname']) That will loop all the features and load the value from columnname into the combo. You will have to add more smarts to that if you need more logic. If you are in your initFunction you already have the layer: def init(dialog, feature, layer): for feature in layer.getFeatures(): . Nathan On Fri, Dec 20, 2013 at 10:03 PM, Luca Lanteri mesca...@gmail.com wrote: Hi to all, I'm a newbie with pyqgis so apologize me for the trivial question. I'm trying to create a forms using QT and to add some intelligence into it using the python Init function, present in the Layer properties - field menu. I want to update the data in combo2 on the base of the combo1 choosed value, but I encountered some problem, probably due to my lack of knowled of QGIS API. This is my first problems: I try to read some data from a layer using this code [1]. If the layer is a geometry layer all works fine but if I try to read the data from a table (without geom coloumn) i cant read the attributes. Both object are QgsVectorLayer so I though that I can use the same methods. In order to resolve this problem i just addes a geom coloum to my table but it's just a ploy. The second, and the very real problem, is that when I try to update the the value using the curLayer.changeAttributeValue() method some strange beaviours occours. - If i try to commit changes from the code (using curLayer.commitChanges() ), and I'm in the table form view, Qgis crash. - when I try to commit changes use the toogle editing mode button, and I'm in the table form view, all my changes are lost. - when I try to commit changes use the toogle editing mode button, and I'm just in the form view, changes are lost alternatively once on two saving operation. I don't understand if this is a problem of my code or a qgis bug. Any hint ? I hope to have described the problem clearly. thank in advance Luca [1] alegend = iface.legendInterface() allLayers=alegend.layers() for i in allLayers: if i.name()=='mytab': aLayer=i lista=[] rsTipo=[] for i in afeature: a=i.attributes() l1=i.attributes()[0] l2=i.attributes()[1] l3=i.attributes()[2] l4=i.attributes()[3] alist=[l1,l2,l3,l4] rsTipo.append(alist) ___ 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] problem with forms and python init
you are right, the code now works fine. It was just my fault due to to the fact that I'm trying to take ones first steps with pygis ! thanks for the support and sorry for the noise. Btw I also resolve my second problem described in the first mail. thanks Luca 2013/12/21 Enzo Ciarmoli enzo.ciarm...@csi.it: nevertheless the problem remain the same: if i try to load the data from a table without geometry, values for i.attributes()[1] remain empty. Hi Luca, I tried your sample code and it works... I don't know what's wrong in your situation... If your problem remain the same, I could suggest you to use QgsFeatureRequest with NoGeometry flag (see Detailed Description in: http://www.qgis.org/api/classQgsFeatureRequest.html ) Example: layer = QgsMapLayerRegistry.instance().mapLayersByName('your_table')[0] iter = layer.getFeatures(QgsFeatureRequest().setFlags(QgsFeatureRequest.NoGeometry)) for feat in iter: print feat.attributes() print feat.attributes()[0] print feat.attributes()[1] Ciao! Enzo ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Open a form of a linked table
Hi Andreas, which are the difference from the standard editing forms ? are there some new features ? The first useful thing I saw is that I can copy the attribute without go in start editing mode. thanks 2013/6/5 Bernhard Ströbl bernhard.stro...@jena.de Andreas, you can try my new plugin DataDrivenInputMask (tables need to be in PostgreSql database, though) It is not accepted yet (it's been waiting for almost a month now) but you can check it out from github [1] Bernhard [1] https://github.com/bstroebl/**DataDrivenInputMaskhttps://github.com/bstroebl/DataDrivenInputMask Am 04.06.2013 16:44, schrieb Andreas Neumann: Hi, I have two tables with a 1:n to relation from table A to B. In the form of table B I want to display a button that opens the corresponding record in a form of table A (in a separate window). I know that Matthias Kuhn is working on such functionality for QGIS 2.1 - but I would need a script-based solution now - this project cannot wait for QGIS 2.1 Does someone have a python script that does something like that or similar things? The idea is to have a Python action with a few lines of code that does this and can be associated to a button. Thanks, Andreas __**_ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/**mailman/listinfo/qgis-**developerhttp://lists.osgeo.org/mailman/listinfo/qgis-developer __ Information from ESET Mail Security, version of virus signature database 8411 (20130604) __ The message was checked by ESET Mail Security. http://www.eset.com -- Bernhard Ströbl Anwendungsbetreuer GIS Kommunale Immobilien Jena Am Anger 26 07743 Jena Tel.: 03641 49- 5190 E-Mail: bernhard.stro...@jena.de Internet: www.kij.de Kommunale Immobilien Jena Eigenbetrieb der Stadt Jena Werkleiter: Dr. Götz Blankenburg __ Information from ESET Mail Security, version of virus signature database 8412 (20130604) __ The message was checked by ESET Mail Security. http://www.eset.com __**_ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/**mailman/listinfo/qgis-**developerhttp://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] adding symbols
We have produced a complete set of geological symbols [0] that follow the american FDCG standard and the Italian CARG/ISPRA standard. It would be nice to add them to the future repository. [0] https://code.google.com/p/gissymbology/downloads/list 2013/6/3 Andreas Neumann a.neum...@carto.net: Hi, ok - good. I would be available to discuss things and test the work. I would propose to delay adding more SVG symbols to the main QGIS project until Arun's work is done (QGIS 2.1 or 2.0x) and users can selectively check out certain symbol groups/topics. Having symbols immediately at hand is not critical for QGIS adoption and adding symbols manually is relatively easy. Andreas ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] serious regression out of new vector api needs attention prior to 2.0
It's a known and very annoying bug. Issue was already reported in: http://hub.qgis.org/issues/7321 http://hub.qgis.org/issues/7472 2013/4/23 Mathieu Pellerin nirvn.a...@gmail.com Greetings, I've filed an issue over the weekend which IMO is a really serious regression which shouldn't be left unresolved prior to the imminent 2.0 release. Long story short, when a layer symbology is set to categorized, graduated, or rule-based, all features will disappear when editing feature(s) on that layer (by moving feature or one of its vertex). If the user then leave the edit mode (saving changes or not), all features will reappear. When features disappear, an error pops up in the log window saying Already active iterator on this provider was closed. Data itself is not impacted, but it's a super scary behavior for the average user. It got me to cancel edits many, many times before I understood what was happening. Issue filed can be reached here: http://hub.qgis.org/issues/7660 Mathieu ___ 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] Print composer legend group removal problem
Yes, I confirm the problem with Win7 QGIS 1.9 (93ade1f) did you have already open a ticket ? 2013/3/28 Ramon Andiñach cust...@westnet.com.au: Hi, Today I needed to remove a subgroup of items from a legend in a print composer. I selected the layer title from the list, clicked the minus button and the subgroup and next subgroup below are removed. Can anyone confirm this? Win7 QGIS 1.9 (87265c7) -ramon. ___ 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