Re: [Qgis-user] python plugin action vs mode tool
On Jan 16, 2008 8:42 PM, Richard Duivenvoorde <[EMAIL PROTECTED]> wrote: > > My 'problem': I've build a sort of XY-Info tool plugin, like the raster > info plugin in the repository. But mine is suppossed to be a tool like > the zoom tool, or the select tool: you click on the tool/plugin-button, > the button gets activated/surpressed/darker, and keeps in that state > until you select one of the other (zoom, select or info) tools. Current > plugin-buttons do not get 'activated', when you click the plugin button > it doesn't stay visually(!)'active', it's a clickclack button. To get the behaviour the only thing you have to do is to call map tool's setAction() or setButton() method. That will cause that when the tool is activated/deactivated, the associated action or button will get selected/delected. (This behaviour is implemented in QgsMapTool::activate() and QgsMapTool::deactivate() so that's why it's good to call them also if you reimplement these methods.) > But still some details were not clear for me: for example it's not clear > for me if you must make a new 'tool' when you want to make a plugin > which does something with a click in the mapcanvas. No, you can use ready-made QgsMapToolEmitPoint tool and just connect to its gotPoint signal. > Another question is > the one about keeping a button 'activated'. I hope that one got answered above. > My idea is to make some 'plugin-stubs' for different kind of simple > plugins: eg starting with a very simple plugin which does not have an > interaction with the map, to a tool like the xy-info tool which must > handle a mouse click, and finally your copyright-plugin which was really > helpful for me. > But maybe a plugin stubb is not what I'm looking for: it's either to > complicated because you want to make it technically useful, or it's to > simple to be functionally useful. The idea was to hand beginners the > first steps to to a really easy plugin. Probably the best way would be to create the same "starting" plugin as the template plugin written in c++. For the rest I think it's better to use code snippets... > But maybe we need a code-snippets wiki page with questions like: > - I want to keep de plugin button activated > - I want to get hold of the active geometries of the active layer > - I want to loop through all geometries of this layer > - How do I test the type of a geometry > - How do I make pixel coordinates from world coordinates and vice versa > - How can I add a label to a (new) layer > - How can I add a new geometry to a layer > - How can I keep some project info by writing it to a project file > etc etc. > ... I should start this page myself maybe ... Well, some of those are already on PythonBindings wiki page, however some are probably missing :) I'll see what more could I add. For sure you can start a list of such simple tasks, we could address them with the code snippets. > ps (referring to my buffer questions a while a go) if you point me to > some 'easy' buffer algorithms, I'm ready to give C++ a try :-) ) Uhm, starting from r7986 you can use QgsGeometry::buffer() function that does exactly what you need :-) Obligatory snippet: gLine = QgsGeometry.fromPolyline( [ QgsPoint(1,1), QgsPoint(2,2) ] ) # buffer with distance 0.5, use 5 segments to approximate curves gBuffer = gLine.buffer(0.5, 5) print gBuffer.asPolygon() Enjoy! Martin ___ Qgis-user mailing list Qgis-user@lists.qgis.org http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user
Re: [Qgis-user] python plugin action vs mode tool
Martin Dobias wrote: >> - I was not able to 'enable' my plugin button, aka: make it a little >> darker so you know that you're still in the xyz-mode. Can somebody point >> me to such an example, or are plugins not supposed to work like this? > > I don't get what you mean. Could you explain it? My 'problem': I've build a sort of XY-Info tool plugin, like the raster info plugin in the repository. But mine is suppossed to be a tool like the zoom tool, or the select tool: you click on the tool/plugin-button, the button gets activated/surpressed/darker, and keeps in that state until you select one of the other (zoom, select or info) tools. Current plugin-buttons do not get 'activated', when you click the plugin button it doesn't stay visually(!)'active', it's a clickclack button. ... > Actually, using plugin installer you can get already to some very > simple plugins. Copyright plugin is an example of plugin which shows > you a dialog for settings, Aaron's recent Raster info plugin is an > example which uses map canvas (and its own map tool). > But definitely there could be a simple example plugin in QGIS sources > that would be ready to be used. Volunteers? :) > Well, but you still must know Qt to do anything more complicated than > just a hello world plugin. I'm a sort of beginner. Using the copyright plugin I hacked by the html-image-map tool (which is in the repository) using trial and error, and was able to use Qt etc etc (see http://www.duif.net/qgis). But still some details were not clear for me: for example it's not clear for me if you must make a new 'tool' when you want to make a plugin which does something with a click in the mapcanvas. Another question is the one about keeping a button 'activated'. My idea is to make some 'plugin-stubs' for different kind of simple plugins: eg starting with a very simple plugin which does not have an interaction with the map, to a tool like the xy-info tool which must handle a mouse click, and finally your copyright-plugin which was really helpful for me. But maybe a plugin stubb is not what I'm looking for: it's either to complicated because you want to make it technically useful, or it's to simple to be functionally useful. The idea was to hand beginners the first steps to to a really easy plugin. But maybe we need a code-snippets wiki page with questions like: - I want to keep de plugin button activated - I want to get hold of the active geometries of the active layer - I want to loop through all geometries of this layer - How do I test the type of a geometry - How do I make pixel coordinates from world coordinates and vice versa - How can I add a label to a (new) layer - How can I add a new geometry to a layer - How can I keep some project info by writing it to a project file etc etc. ... I should start this page myself maybe ... Thanks, and people should really look into the blog and wiki for your examples, they are really helpful! Regards Richard Duivenvoorde ps (referring to my buffer questions a while a go) if you point me to some 'easy' buffer algorithms, I'm ready to give C++ a try :-) ) ___ Qgis-user mailing list Qgis-user@lists.qgis.org http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user
Re: [Qgis-user] bug : ECW raster not display correctly
hi I would suggest to try to replicate against svn trunk first since Peter Ersts has merged in many changes and improvements for raster. If the problem still occurs please file a bug. Attaching (small .jpg) screenshots to the bug report if needed. Please be sure to provide descriptions of the images describing which are 'normal' and which have errors. Regards Tim 2008/1/16, Jacolin Yves <[EMAIL PROTECTED]>: > Le Friday 11 January 2008 11:10:45 Jacolin Yves, vous avez écrit: > > Hi, > > > > I have find an another bug, always in the 0.9.1 release. You can see some > > screenshots here : http://softlibre.free.fr/bug/qgis/0.9.1/ > > > > I displayed two tiles of ECW raster. the file bug_ecw_3.png show all the > > tile correctly. If I zoom in, the tile is not displaying correctly, see all > > other files bug_ecw_*.png with various zoom level. > > > > are you aware of this bug? Do I need to fill a bug? Someone could reproduce > > this bug? > > > > Thanks, > > > > Y. > > Do I need to fill a bug report? Or do I suppose that nobody have this problem? > > Y. > -- > Yves Jacolin > --- > http://softlibre.gloobe.org > ___ > Qgis-user mailing list > Qgis-user@lists.qgis.org > http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user > -- Tim Sutton QGIS Project Steering Committee Member - Release Manager Visit http://qgis.org for a great open source GIS openModeller Desktop Developer Visit http://openModeller.sf.net for a great open source ecological niche modelling tool Home Page: http://tim.linfiniti.com Skype: timlinux Irc: timlinux on #qgis at freenode.net ___ Qgis-user mailing list Qgis-user@lists.qgis.org http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user
Re: [Qgis-user] gps problem
Hi QGIS doesnt have language bindings for java so I guess you are calling qgis as a system process? The screenshot command line option is using the same (gui based) application binary as QGIS desktop - hence the possibility for the visual side effects. For a more robust solution I would suggest making a simple libqgis_core based command line app to load your maps and create an image output. There are a number of examples for python and c++ available, and the tests/src/core unit tests have additional routines that can be adopted as the basis for such a simple command line app. Regards Tim 2008/1/16, Tolga Tanriverdi <[EMAIL PROTECTED]>: > I'm using java for my project > > -Original Message- > From: Tim Sutton [mailto:[EMAIL PROTECTED] > Sent: 16 Ocak 2008 Çarşamba 11:29 > To: Tolga Tanriverdi > Cc: qgis-user@lists.qgis.org > Subject: Re: [Qgis-user] gps problem > > Hi > > 2008/1/15, Tolga Tanriverdi <[EMAIL PROTECTED]>: > > > > > > > > > > Hi > > I'm new to whole qgis thing and I'm trying to develop a gis application > > with using qgis but I want to use qgis as a command line tool > > Which language are you developing with - python or c++? > > Regards > > Tim > > > > so I have created the project with qgis gui and saved it as a qgis project, > > now what I want is to send qgis a gpx file for using it's gps addon and take > > the snapshot of the project as a png file with --snapshot parameter > > however I couldnt find any way to give gpx file name as a project parameter > > does anyone know how can i do that ? > > My second question is when I called qgis with --snapshot parameter a gui of > > qgis appears for an instance is there a way to stop this? > > Thanks > > > > > > > > Tolga Tanrıverdi > > > > Aydın Yazılım ve Elektronik Sanayii A.Ş > > > > Ağ Sistem Mühendisi > > > > (0312)2101565-134 > > > > > > ___ > > Qgis-user mailing list > > Qgis-user@lists.qgis.org > > http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user > > > > > > > -- > Tim Sutton > QGIS Project Steering Committee Member - Release Manager > Visit http://qgis.org for a great open source GIS > openModeller Desktop Developer > Visit http://openModeller.sf.net for a great open source ecological > niche modelling tool > Home Page: http://tim.linfiniti.com > Skype: timlinux > Irc: timlinux on #qgis at freenode.net > > > Bu e-posta, mesaji alici kisminda belirtilmis olan kullanici icindir. Mesajin > alicisi siz degilseniz dogrudan veya dolayli olarak mesaji kullanmayiniz, > acmayiniz, dagitmayainiz, yazicidan dokumunu almayiniz veya herhangi bir > kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz > ve tum kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj > icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu > gorusler Aydın Yazılım ve Elektronik Sanayii A.Ş. (AYESAŞ)'ın goruslerini > yansitmadigi gibi, AYESAŞ'ı baglayici da degildir. Bu mesajin iceriginde ya > da eklerinde yer alan bilgilerin dogrulugu, butunlugu ve guncelligi AYESAŞ > tarafindan garanti edilmemektedir ve bilinen viruslere karsi kontrolleri > yapilmis olarak yollanan mesajin sitenizde yaratabilecegi zararlardan AYESAŞ > sorumlu tutulamaz. > > This email is intended solely for the use of the individual or entity to whom > it is adressed. If you are not the intended adressee of this message, you > should not use, open, disseminate, distrubute, print or copy this e-mail. If > you have received this email in error. please delete it from your system and > notify the sender immediately. Aydın Yazılım ve Elektronik Sanayii A.Ş. > (AYESAŞ) does not accept any legal responsibility whatsoever for the contents > of this message. Any opinions contained in this message are those of the > author and are not given or endorsed by the AYESAŞ. AYESAŞ does not warrant > the accuracy, integrity and currency of the information transmitted with this > message. This message has been detected for all known computer viruses thence > AYESAŞ is not liable for the occurrence of any system corruption caused by > this message. > -- Tim Sutton QGIS Project Steering Committee Member - Release Manager Visit http://qgis.org for a great open source GIS openModeller Desktop Developer Visit http://openModeller.sf.net for a great open source ecological niche modelling tool Home Page: http://tim.linfiniti.com Skype: timlinux Irc: timlinux on #qgis at freenode.net ___ Qgis-user mailing list Qgis-user@lists.qgis.org http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user
Re: [Qgis-user] [bug] Crash of QGIS 0.9.1 opening attribut table
Hi Jacolin Your bug report looks fine - thanks - I will assign it to Marco who works in this area mainly. Regards Tim 2008/1/16, Jacolin Yves <[EMAIL PROTECTED]>: > Hi Tim, > > Here is the bug number: > https://svn.qgis.org/trac/ticket/907 > > I hope I fill the form correctly, if I did something wrong, tell me to improve > my bug report. > > Y. > Le Thursday 10 January 2008 17:13:17 Tim Sutton, vous avez écrit: > > Hi Jacolin > > > > Do you have a bug tracker account? Contact me if you need one. Please > > check that there isnt an existing bug report for this. If there is > > append your comments. If not feel free to open a new bug. > > > > Regards > > > > Tim > > > > 2008/1/10, Jacolin Yves <[EMAIL PROTECTED]>: > > > HI list, > > > > > > I would like to confirm a bug which crash QGIS 0.9.1. > > > > > > I am editing a layer, copying-pasting a feature from a layer to another > > > one. As the attribute table are different for the two layers, when I save > > > my modification, a windows alert me that there is a problem with the type > > > of the fields XXX (which is boolean, and I try to instert text for > > > example). > > > > > > With the 0.8.0 release, I opened the atribut table, looking for the -1 id > > > and change the incorrect data and save my layer. However, with the 0.9.1 > > > release, QGIS crash when I try to open the attribut table. > > > > > > Do you this issue? Do I need to fill a bug report? Does someone can > > > reproduce this bug? > > > > > > Thanks for your great work. > > > > > > Y. > > > -- > > > Yves Jacolin > > > --- > > > http://softlibre.gloobe.org > > > ___ > > > Qgis-user mailing list > > > Qgis-user@lists.qgis.org > > > http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user > > > > -- > Yves Jacolin > --- > http://softlibre.gloobe.org > ___ > Qgis-user mailing list > Qgis-user@lists.qgis.org > http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user > -- Tim Sutton QGIS Project Steering Committee Member - Release Manager Visit http://qgis.org for a great open source GIS openModeller Desktop Developer Visit http://openModeller.sf.net for a great open source ecological niche modelling tool Home Page: http://tim.linfiniti.com Skype: timlinux Irc: timlinux on #qgis at freenode.net ___ Qgis-user mailing list Qgis-user@lists.qgis.org http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user
Re: [Qgis-user] bug : ECW raster not display correctly
Le Friday 11 January 2008 11:10:45 Jacolin Yves, vous avez écrit : > Hi, > > I have find an another bug, always in the 0.9.1 release. You can see some > screenshots here : http://softlibre.free.fr/bug/qgis/0.9.1/ > > I displayed two tiles of ECW raster. the file bug_ecw_3.png show all the > tile correctly. If I zoom in, the tile is not displaying correctly, see all > other files bug_ecw_*.png with various zoom level. > > are you aware of this bug? Do I need to fill a bug? Someone could reproduce > this bug? > > Thanks, > > Y. Do I need to fill a bug report? Or do I suppose that nobody have this problem? Y. -- Yves Jacolin --- http://softlibre.gloobe.org ___ Qgis-user mailing list Qgis-user@lists.qgis.org http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user
Re: [Qgis-user] [bug] Crash of QGIS 0.9.1 opening attribut table
Hi Tim, Here is the bug number: https://svn.qgis.org/trac/ticket/907 I hope I fill the form correctly, if I did something wrong, tell me to improve my bug report. Y. Le Thursday 10 January 2008 17:13:17 Tim Sutton, vous avez écrit : > Hi Jacolin > > Do you have a bug tracker account? Contact me if you need one. Please > check that there isnt an existing bug report for this. If there is > append your comments. If not feel free to open a new bug. > > Regards > > Tim > > 2008/1/10, Jacolin Yves <[EMAIL PROTECTED]>: > > HI list, > > > > I would like to confirm a bug which crash QGIS 0.9.1. > > > > I am editing a layer, copying-pasting a feature from a layer to another > > one. As the attribute table are different for the two layers, when I save > > my modification, a windows alert me that there is a problem with the type > > of the fields XXX (which is boolean, and I try to instert text for > > example). > > > > With the 0.8.0 release, I opened the atribut table, looking for the -1 id > > and change the incorrect data and save my layer. However, with the 0.9.1 > > release, QGIS crash when I try to open the attribut table. > > > > Do you this issue? Do I need to fill a bug report? Does someone can > > reproduce this bug? > > > > Thanks for your great work. > > > > Y. > > -- > > Yves Jacolin > > --- > > http://softlibre.gloobe.org > > ___ > > Qgis-user mailing list > > Qgis-user@lists.qgis.org > > http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user -- Yves Jacolin --- http://softlibre.gloobe.org ___ Qgis-user mailing list Qgis-user@lists.qgis.org http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user
Re: [Qgis-user] gps problem
Hi 2008/1/15, Tolga Tanriverdi <[EMAIL PROTECTED]>: > > > > > Hi > I'm new to whole qgis thing and I'm trying to develop a gis application > with using qgis but I want to use qgis as a command line tool Which language are you developing with - python or c++? Regards Tim > so I have created the project with qgis gui and saved it as a qgis project, > now what I want is to send qgis a gpx file for using it's gps addon and take > the snapshot of the project as a png file with --snapshot parameter > however I couldnt find any way to give gpx file name as a project parameter > does anyone know how can i do that ? > My second question is when I called qgis with --snapshot parameter a gui of > qgis appears for an instance is there a way to stop this? > Thanks > > > > Tolga Tanrıverdi > > Aydın Yazılım ve Elektronik Sanayii A.Ş > > Ağ Sistem Mühendisi > > (0312)2101565-134 > > > ___ > Qgis-user mailing list > Qgis-user@lists.qgis.org > http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user > > -- Tim Sutton QGIS Project Steering Committee Member - Release Manager Visit http://qgis.org for a great open source GIS openModeller Desktop Developer Visit http://openModeller.sf.net for a great open source ecological niche modelling tool Home Page: http://tim.linfiniti.com Skype: timlinux Irc: timlinux on #qgis at freenode.net ___ Qgis-user mailing list Qgis-user@lists.qgis.org http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user
Re: [Qgis-user] problem to install libgdal1-1.4.0-grass
Hi Thomas, libgdal1-1.4.0-grass_1.4.1-1ubuntu1_i386.deb and libgdal1-grass probably is the same package, but a different version. I guess it won't be a problem to let the update overwright the ellipse.table file from the older version. Regards, Otto On Mon, 14 Jan 2008 10:26:58 -0800 (PST) rs_open <[EMAIL PROTECTED]> wrote: > > Hi, > > while updating my system i run into a problem on my ubuntu system (gutsy > gibbon). Apt-get is telling me to install libgdal1-1.4.0-grass, but the > package libgdal1-1.4.0-grass_1.4.1-1ubuntu1_i386.deb is trying to overwrite > /usr/share/gdal/grass/etc/ellipse.table which belongs to libgdal1-grass. > > Can you give me an advice what to do? > > Cheers, > Thomas ___ Qgis-user mailing list Qgis-user@lists.qgis.org http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user
[Qgis-user] gps problem
Hi I'm new to whole qgis thing and I'm trying to develop a gis application with using qgis but I want to use qgis as a command line tool so I have created the project with qgis gui and saved it as a qgis project, now what I want is to send qgis a gpx file for using it's gps addon and take the snapshot of the project as a png file with --snapshot parameter however I couldnt find any way to give gpx file name as a project parameter does anyone know how can i do that ? My second question is when I called qgis with --snapshot parameter a gui of qgis appears for an instance is there a way to stop this? Thanks Tolga Tanrıverdi Aydın Yazılım ve Elektronik Sanayii A.Ş Ağ Sistem Mühendisi (0312)2101565-134 ___ Qgis-user mailing list Qgis-user@lists.qgis.org http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user
[Qgis-user] problem to install libgdal1-1.4.0-grass
Hi, while updating my system i run into a problem on my ubuntu system (gutsy gibbon). Apt-get is telling me to install libgdal1-1.4.0-grass, but the package libgdal1-1.4.0-grass_1.4.1-1ubuntu1_i386.deb is trying to overwrite /usr/share/gdal/grass/etc/ellipse.table which belongs to libgdal1-grass. Can you give me an advice what to do? Cheers, Thomas -- View this message in context: http://www.nabble.com/problem-to-install-libgdal1-1.4.0-grass-tp14808083p14808083.html Sent from the qgis-user mailing list archive at Nabble.com. ___ Qgis-user mailing list Qgis-user@lists.qgis.org http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user