[QGIS-Developer] Plugin rename
Dear all, I'm the maintainer of the plugin opeNoise ( https://plugins.qgis.org/plugins/opeNoise/) The organization paying the maintenance would like to change the name from opeNoise to opeNoise Map Is it possible inside the plugin repo do that? If I just change the name entirely in the project is it enough? Thanks for your help P -- Ing. Pierluigi De Rosa (PhD in Earth Science) Contract Professor of Geographic Information System at University of Perugia cel: 3497558268 / fax: 075 7823038 skype: pierluigi.derosa ___ 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] error adding new feature to empy layer
Dear All, I have a simple case where I created an empty memory line layer in this way: vl = QgsVectorLayer("LineString", "braiding_river", "memory") vl.setCrs(crs) pr = vl.dataProvider() # add fields pr.addAttributes([ QgsField("reach", QVariant.String), QgsField("braiding", QVariant.Double), QgsField("Length", QVariant.Double)]) vl.updateFields() feat_list=[] then I populate the layer where inside a for cycle I have fet = QgsFeature() fet.setGeometry(QgsGeometry.fromPolylineXY(reach)) #reach is a list of QgsPointXY fet.setAttributes([ str(breakval), brIndex, lenReach]) feat_list.append(fet) Outside for cycle I do: (result, newFeatures) = pr.addFeatures(feat_list) But I have always result to False so the feature is not added. I think could be a problem related to the id of feature so I tried also to use fet.setId() ad passing a specific unique value but the result is the same. can Anyone help me please? Thanks Pierluigi -- Ing. Pierluigi De Rosa (PhD in Earth Science) Contract Professor of Geographic Information System at University of Perugia cel: 3497558268 / fax: 075 7823038 skype: pierluigi.derosa ___ 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] QgsFieldCombobox already populated
Dear all, since QGIS 3.22 the actual LTR I noticed that the QgsFieldCombobox is already populated. In particular I have a plugin that in QGIS 3.18 and previous when opening the GUI, after selecting the layer from che QgsLayerCombobox I have to select the field related to this layer. Now After selecting the layer all the field combobox are already populated with the first field in the attribute table. In this case the user has to re-select all fields. This change the user experience also because in my plugin sometimes I don't have to select all fields combobox. Is there a way to have the same behavior between QGIS 3.22 and previous QGIS 3.18? What has changed in particular and It exists a way to restore previous behaviour (do not fill automatically the field combobox)? Thank you for you feedback Pierluigi -- Ing. Pierluigi De Rosa (PhD in Earth Science) Contract Professor of Geographic Information System at University of Perugia cel: 3497558268 / fax: 075 7823038 skype: pierluigi.derosa ___ 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] deleteShapefile in pyqgis
Yes I'm on Windows. On Linux the code works fine. P Il Mar 22 Feb 2022, 18:25 Etienne Trimaille ha scritto: > Hi, > > Are you on Windows ? > > It's long-standing issue on Windows IIRC : > > https://gis.stackexchange.com/questions/365713/deleting-shapefile-python-lock-qgis-3-10 > or other links. > > Maybe > lyr = QgsProject.instance().mapLayersByName(diff_layer)[0] > QgsProject.instance().removeMapLayer(lyr.id()) > lyr = None > del lyr > > But not a real answer ... > > FYI, a nice helper to know side car files: > > https://qgis.org/api/classQgsFileUtils.html#a8db232d5063ae13133fa2d3351be1b9c > > Le mar. 22 févr. 2022 à 18:07, pierluigi de rosa < > pierluigi.der...@gmail.com> a écrit : > >> Dear all, >> >> I have some troubles wher I use in a pyqgis the function >> QgsVectorFileWriter.deleteShapeFile(file_path) >> here below the example: >> >> def removeLayer(path_layer): >> # remove layer from TOC if already loaded >> basefile = os.path.basename(path_layer) >> diff_layer = os.path.splitext(basefile)[0] >> directory = os.path.dirname(path_layer) >> extensions = ["shp", "shx", "dbf", "prj", "sbn", "sbx", "fbn", "fbx", >> "ain", "aih", "ixs", "mxs", "atx", "xml", >> "cpg", "qix"] >> output_path=path_layer >> if os.path.exists(path_layer): >> if len(QgsProject.instance().mapLayersByName(diff_layer)) > 0: >> lyr = QgsProject.instance().mapLayersByName(diff_layer)[0] >> print('renaming layer1: ', lyr.id()) >> QgsProject.instance().removeMapLayer(lyr.id()) >> >> QgsVectorFileWriter.deleteShapeFile(path_layer) >> >> Often some handles still remains and I'm not able to delete .dbf and .shp >> files >> How can I solve this error? >> >> Thanks >> Pierluigi >> >> -- >> Ing. Pierluigi De Rosa (PhD in Earth Science) >> Contract Professor of Geographic Information System at University of >> Perugia >> cel: 3497558268 / fax: 075 7823038 >> skype: pierluigi.derosa >> ___ >> 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] deleteShapefile in pyqgis
Dear all, I have some troubles wher I use in a pyqgis the function QgsVectorFileWriter.deleteShapeFile(file_path) here below the example: def removeLayer(path_layer): # remove layer from TOC if already loaded basefile = os.path.basename(path_layer) diff_layer = os.path.splitext(basefile)[0] directory = os.path.dirname(path_layer) extensions = ["shp", "shx", "dbf", "prj", "sbn", "sbx", "fbn", "fbx", "ain", "aih", "ixs", "mxs", "atx", "xml", "cpg", "qix"] output_path=path_layer if os.path.exists(path_layer): if len(QgsProject.instance().mapLayersByName(diff_layer)) > 0: lyr = QgsProject.instance().mapLayersByName(diff_layer)[0] print('renaming layer1: ', lyr.id()) QgsProject.instance().removeMapLayer(lyr.id()) QgsVectorFileWriter.deleteShapeFile(path_layer) Often some handles still remains and I'm not able to delete .dbf and .shp files How can I solve this error? Thanks Pierluigi -- Ing. Pierluigi De Rosa (PhD in Earth Science) Contract Professor of Geographic Information System at University of Perugia cel: 3497558268 / fax: 075 7823038 skype: pierluigi.derosa ___ 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] projected CRS
Thanks Etienne. isGeographic() is what I need for. Pierluigi Il giorno mer 13 ott 2021 alle ore 12:09 Etienne Trimaille < etienne.trimai...@gmail.com> ha scritto: > Hi > On the CRS object, isGeographic() and mapUnits() might help you. > > Le mer. 13 oct. 2021 à 11:50, pierluigi de rosa < > pierluigi.der...@gmail.com> a écrit : > >> Dear all, >> >> mayble a very simple question. >> Is it possible to check quickly if a layer has a projected CRS or not? >> in QgsCoordinateReferenceSystem I have not found a method able to do that >> check. >> Thanks for your attention >> Pierluigi >> >> -- >> Ing. Pierluigi De Rosa (PhD in Earth Science) >> Contract Professor of Geographic Information System at University of >> Perugia >> cel: 3497558268 / fax: 075 7823038 >> skype: pierluigi.derosa >> ___ >> 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 >> > -- Ing. Pierluigi De Rosa (PhD in Earth Science) Contract Professor of Geographic Information System at University of Perugia cel: 3497558268 / fax: 075 7823038 skype: pierluigi.derosa ___ 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] projected CRS
Dear all, mayble a very simple question. Is it possible to check quickly if a layer has a projected CRS or not? in QgsCoordinateReferenceSystem I have not found a method able to do that check. Thanks for your attention Pierluigi -- Ing. Pierluigi De Rosa (PhD in Earth Science) Contract Professor of Geographic Information System at University of Perugia cel: 3497558268 / fax: 075 7823038 skype: pierluigi.derosa ___ 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] Duplicate the extent layer selection in processing
Dear all, I would like to duplicate the useful tool used in processing for the extend layer selector in a personalized QDialog. Instead of write anything from scratch where I can find a snippet do duplicate? Thanks to all Pierluigi -- Ing. Pierluigi De Rosa (PhD in Earth Science) Contract Professor of Geographic Information System at University of Perugia cel: 3497558268 / fax: 075 7823038 skype: pierluigi.derosa ___ 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] process bar in processing algs
Thanks guys, I solved my problem In particular it was the feedback.progressChanged.connect suggested by German the missing part. Cheers Pierluigi Il giorno mar 20 lug 2021 alle ore 15:20 Germán Carrillo < carrillo.ger...@gmail.com> ha scritto: > Hi Pierluigi, > > > you need to create your own *feedback* object and connect its > *progressChanged* SIGNAL to your progressbar's *setValue* SLOT, in this > way: > > > feedback = QgsProcessingFeedback() > feedback.progressChanged.connect(progressBarGrid.setValue) > > params_creategrid = { > # Set key-value parameters > } > result_grid = processing.run("native:creategrid", params_creategrid, > feedback=feedback) > > > Source: https://gis.stackexchange.com/a/348588/4972 > > > Regards, > > Germán > > El mar, 20 jul 2021 a las 4:52, matteo () > escribió: > >> Hi Pierluigi, >> >> >> > can you please explain me better? >> > I have self plugin that in particular part use this code >> > >> > result_grid = processing.run("native:creategrid", params_creategrid) >> >> as explained by Prem, if you want to add the progress when you call a >> "native" algorithm of QGIS within your algorithm, then you can pass to >> the algorithm parameters: >> >> result_grid = processing.run("native:creategrid", params_creategrid, >> context=context, feedback=feedback) >> >> be aware also at the `is_child` parameter. Have a look at the example: >> >> >> https://docs.qgis.org/3.4/en/docs/user_manual/processing/scripts.html#extending-qgsprocessingalgorithm >> >> if you want to add steps to the progressBar with your logic then you can >> use feedback.setProgress(number) to fill the progress bar. Have a look >> at the template script and you will find a fine usage >> >> Hope this helps >> >> Matteo >> ___ >> 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 >> > > > -- > --- >|\__ > (:>__)( >|/ > Soluciones Geoinformáticas Libres > http://geotux.tuxfamily.org/ > https://twitter.com/GeoTux2 <http://twitter.com/GeoTux2> > > -- Ing. Pierluigi De Rosa (PhD in Earth Science) Contract Professor of Geographic Information System at University of Perugia cel: 3497558268 / fax: 075 7823038 skype: pierluigi.derosa ___ 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] process bar in processing algs
Hi Matteo, can you please explain me better? I have self plugin that in particular part use this code result_grid = processing.run("native:creategrid", params_creategrid) But I would like to use note the progressBar of processing but a personal bar in the QDialog It is possible? P Il giorno mar 20 lug 2021 alle ore 11:01 matteo ha scritto: > Hi Pierluigi, > > you can fill the progressBar of the Processing algorithm with > feedback.setProgress(integer). > > Hope this helps > > Matteo > -- Ing. Pierluigi De Rosa (PhD in Earth Science) Contract Professor of Geographic Information System at University of Perugia cel: 3497558268 / fax: 075 7823038 skype: pierluigi.derosa ___ 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] process bar in processing algs
Dear User, I have a plugin that call a processing alghoritm I would like to communicate to the user with a progress bar below my code: # native:creategrid params_creategrid = { 'CRS': crs_layer, 'EXTENT': extent_coords, 'HOVERLAY': 0, 'HSPACING': resolution, 'OUTPUT': 'memory:', 'TYPE': 0, 'VOVERLAY': 0, 'VSPACING': resolution } result_grid = processing.run("native:creategrid", params_creategrid) grid_output = result_grid['OUTPUT'] I would like to show a progressbar in my QprogressBar called progressBarGrid. Thanks for your help Pierluigi -- Ing. Pierluigi De Rosa (PhD in Earth Science) Contract Professor of Geographic Information System at University of Perugia cel: 3497558268 / fax: 075 7823038 skype: pierluigi.derosa ___ 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] QgsMapLayerCombobox with multiple filters
Thanks a lot for your answer. I solved my problem P Il giorno lun 12 lug 2021 alle ore 19:56 Benjamin Jakimow < benjamin.jaki...@geo.hu-berlin.de> ha scritto: > Hi Pierluigi, > > you need to combine the Flags as binary Or ('|') : > > self.overlayLayer_ComboBox.setFilters(QgsMapLayerProxyModel.PointLayer | > QgsMapLayerProxyModel.LineLayer) > > /Benjamin > > On 2021-07-12 19:51, pierluigi de rosa wrote: > > Dear All, > > I'm experiencing some problems with the QgsMapLayerComboBox. > I would like to filter all line and polygon layer. > Here below my code: > > self.overlayLayer_ComboBox.setFilters(QgsMapLayerProxyModel.PointLayer,QgsMapLayerProxyModel.LineLayer) > > But I have and Error. I can add only one layer type. Even the > QgsmapLayerProxyModel.VectorLayer > <https://qgis.github.io/pyqgis/3.2/core/Map/QgsMapLayerProxyModel.html?highlight=qgsmaplayerproxymodel%20pointlayer#qgis.core.QgsMapLayerProxyModel.VectorLayer> > is > not suitable. > I want to show only line and polygon. > Can anyone help me? > Thank you > Pierluigi > -- > Ing. Pierluigi De Rosa (PhD in Earth Science) > Contract Professor of Geographic Information System at University of > Perugia > cel: 3497558268 / fax: 075 7823038 > skype: pierluigi.derosa > > ___ > 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 > > > -- > -- > Benjamin Jakimow, Doctoral Researcher > Earth Observation Lab | Geography Department | Humboldt-Universität zu > Berlin > > e-mail: benjamin.jaki...@geo.hu-berlin.de > > phone: +49 (0) 30 2093 6894 > mobile: +49 (0) 157 5656 8477 > fax:+49 (0) 30 2093 6848 > mail: Unter den Linden 6 | 10099 Berlin | Germany > room: 2'222 > -- Ing. Pierluigi De Rosa (PhD in Earth Science) Contract Professor of Geographic Information System at University of Perugia cel: 3497558268 / fax: 075 7823038 skype: pierluigi.derosa ___ 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] QgsMapLayerCombobox with multiple filters
Dear All, I'm experiencing some problems with the QgsMapLayerComboBox. I would like to filter all line and polygon layer. Here below my code: self.overlayLayer_ComboBox.setFilters(QgsMapLayerProxyModel.PointLayer,QgsMapLayerProxyModel.LineLayer) But I have and Error. I can add only one layer type. Even the QgsmapLayerProxyModel.VectorLayer <https://qgis.github.io/pyqgis/3.2/core/Map/QgsMapLayerProxyModel.html?highlight=qgsmaplayerproxymodel%20pointlayer#qgis.core.QgsMapLayerProxyModel.VectorLayer> is not suitable. I want to show only line and polygon. Can anyone help me? Thank you Pierluigi -- Ing. Pierluigi De Rosa (PhD in Earth Science) Contract Professor of Geographic Information System at University of Perugia cel: 3497558268 / fax: 075 7823038 skype: pierluigi.derosa ___ 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] Issue in string translation
Dear All, I'm working on a plugin that has been ported to QGIS 3.x Everything works fine, even all translations are corrected generated in all other .py files I'm not able to translate the string in the main .py file of the plugin. In the initGui function I have these lines: self.CreateReceiverPoints_item = QAction(QIcon(" :/plugins/opeNoise/icons/icon_CreateReceiverPoints.png"), self.tr("Create Receiver Points"), self.iface.mainWindow()) Even if I double checked that the mainfile openoise.py is added in the / translation.pro such strings are not present inside the corresponding .ts files Where I'm wrong? the code is available here: https://github.com/pierluigiderosa/openoise/tree/qgis3 Thanks to all Pierluigi -- Ing. Pierluigi De Rosa (PhD in Earth Science) Contract Professor of Geographic Information System at University of Perugia cel: 3497558268 / fax: 075 7823038 skype: pierluigi.derosa ___ 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] processing output in pyqgis code
Dear All, I have a strange phenomena running some code. I'm using the processing algorithm qgis:pointsalonglines output = processing.run( "qgis:pointsalonglines" , { 'INPUT' : poly_to_lines , 'DISTANCE' : spaced_pts_distance , 'START_OFFSET' : 0 , 'END_OFFSET' : 0 , 'OUTPUT' : 'memory:' }) The output vector should have 3 columns (FID, angle,Distance) If I run the code inside the python console plugin (even from a sample code) It works correctly but if I run ti inside my plugin, calling such lines inside a method the output only have 2 columns (distance and angle) so the receiver_points_memory_layer = output[ 'OUTPUT' ] Ant picking the attribute table with: receiver_memory_feat[ 'FID' ] tells me attributes = [receiver_points_feat_id, receiver_memory_feat['FID']] KeyError: 'FID' Where I'm wrong? thanks Pierluigi ___ 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] plugin reload fail
Dear Borys, I update the plugin reloader to the version 0.7.5 and I tried to use it on openoise but it still fails. No changes are detected. I'm using QGIS 3.2 and a ported version of openoise (not the official one that is for qgis 2.x) Thanks Pierluigi - Messaggio originale - Da: "Borys Jurgiel" A: qgis-developer@lists.osgeo.org Cc: "Richard Duivenvoorde" Inviato: Sabato, 13 ottobre 2018 23:33:59 Oggetto: Re: [QGIS-Developer] plugin reload fail Hi, It's not so straightforward to recursively reload complex plugins, thus both Plugin Manager and Plugin Reloader have a long-standing problem with reloading modules placed in subdirectories. This is the case of opeNoise, where most of the code is in the 'tools' subdirectory, so all changes there require QGIS to be restarted. I've just released Plugin Reloader 0.7.5 that hopefully fixes this issue finally. Could you please test if it helps with opeNoise? If so, I'll apply the same to the Manager or even qgis.utils. Unfortunately it's only for QGIS 3, as I didn't success to make it working with Python 2 (and the old opeNoise). Best regards, Borys Dnia sobota, 13 października 2018 12:15:28 CEST DelazJ pisze: > Hi, > > How about reloading with the "Plugin reloader" plugin [0]? You might need > to enable "show experimental plugins" beforehand. > I thik this would save QGIS I/O. > > [0] http://plugins.qgis.org/plugins/plugin_reloader/ > > Regards, > Harrissou > > Le sam. 13 oct. 2018 à 10:14, Richard Duivenvoorde a > > écrit : > > On 10/12/2018 06:20 PM, Ing. Pierluigi De Rosa wrote: > > > Dear all, > > > > > > I have a simple problem. > > > I'm porting the opeNoise plugin [1] to 3.x > > > I'm not the author plugin but I'm experiencing that the plugin reload > > > fails. It tels me that the plugin have been reloaded but the changes are > > > non applied. Even if I deactivate and than activate the plugin the same > > > results (no changes detected). > > > The only way is to restart the software any time losing too much time. > > > > How sure are you that it is not reloaded? > > Can you check by writing some message with a version number? > > > > Normally writing the > > > > __init__ > > initGui > > unload > > > > should be enough. Only thing I could think off is that you do not > > disconnect the QActions (though I'm not even sure if that is really > > needed). > > > > Also note that if you reload your plugin AFTER an exception, often you > > end up with a situation where QGIS still has (parts) of the plugin in > > memory while also loading a new version of your plugin, so sometimes > > showing 2 versions of your pluginbutton/toolbar etc. I think only a QGIS > > restart works then. > > > > Another think I've had is that mixing up an already installed version > > with the one I'm developing (because the symbolic link was gone, or I > > was actually working in another profile then I thought or other > > silly things) > > > > Regards, > > > > Richard > > ___ > > 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] plugin reload fail
Dear all, I have a simple problem. I'm porting the opeNoise plugin [1] to 3.x I'm not the author plugin but I'm experiencing that the plugin reload fails. It tels me that the plugin have been reloaded but the changes are non applied. Even if I deactivate and than activate the plugin the same results (no changes detected). The only way is to restart the software any time losing too much time. Can someone help me please? thanks Pierluigi [1] https://github.com/Arpapiemonte/openoise -- -- Ing. Pierluigi De Rosa PhD in Scienze della terra Professore a contratto di G.I.S. presso Università di Perugia Studio Associato GFOSSERVICES Presso CAMPUS Via F.lli Cairoli 24 - 06127 Perugia (PG) fax: 075 7823038 cel: 3497558268 web: www.gfosservices.it skype: pierluigi.derosa ___ 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] QgsMapLayerComboBox add None
Thanks good to know. Pierluigi Il giorno mar, 06/06/2017 alle 00.23 +0800, Etienne Trimaille ha scritto: > Yes it's possible with the QGIS 3 API only: > > https://qgis.org/api/classQgsMapLayerComboBox.html#a3f38873230e93d6bc7d73a50671a9c5e > > > > 2017-06-05 23:23 GMT+08:00 Ing. Pierluigi De Rosa > : > > Dear all, > > into the QgsMapLayerComboBox is there a simple way to add the > --None-- > option for the list of layer? > Normally the widget is already full of all layer but I need > also the > option: no layer > > What is the best solution to do that? > Thanks > Pierluigi > > -- > -- > > > > > > > ____ > Ing. Pierluigi De Rosa > PhD in Scienze della terra > Professore a contratto di G.I.S. presso Università di Perugia > > Studio Associato GFOSSERVICES > > Presso CAMPUS Via F.lli Cairoli 24 - 06127 Perugia (PG) > fax: 075 7823038 > cel: 3497558268 > web: www.gfosservices.it > skype: pierluigi.derosa > > ___ > 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 > > > -- -- Ing. Pierluigi De Rosa PhD in Scienze della terra Professore a contratto di G.I.S. presso Università di Perugia Studio Associato GFOSSERVICES Presso CAMPUS Via F.lli Cairoli 24 - 06127 Perugia (PG) fax: 075 7823038 cel: 3497558268 web: www.gfosservices.it skype: pierluigi.derosa ___ 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] QgsMapLayerComboBox add None
Dear all, into the QgsMapLayerComboBox is there a simple way to add the --None-- option for the list of layer? Normally the widget is already full of all layer but I need also the option: no layer What is the best solution to do that? Thanks Pierluigi -- -- Ing. Pierluigi De Rosa PhD in Scienze della terra Professore a contratto di G.I.S. presso Università di Perugia Studio Associato GFOSSERVICES Presso CAMPUS Via F.lli Cairoli 24 - 06127 Perugia (PG) fax: 075 7823038 cel: 3497558268 web: www.gfosservices.it skype: pierluigi.derosa ___ 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] split line at specified distance
Dear all, I have some difficulties to figure out how to split line at specific distance from the beginning. I need to split a single line into several lines at specific distances. I'm able to get the point at specific distance using the intersection function of QgsGeometry but I'm in trouble on how to create the new geometry. I looked at the split function but I'm not sure it could help me. Do you have some code to share on how to split a line into several lines at specified distances? Thanks Pierluigi ___ 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] Crowdfunding campaign for a Point Cluster Renderer
Hi Nyall, It looks a nice feature. I twitted you message right now :) P - Messaggio originale - Da: "Nyall Dawson" A: "qgis-developer" , "qgis-user" Inviato: Martedì, 26 luglio 2016 6:33:38 Oggetto: [Qgis-developer] Crowdfunding campaign for a Point Cluster Renderer Hi all, I've just launched a new crowdfunding campaign to implement a web-mapping style cluster renderer for QGIS: http://north-road.com/qgis-cluster-renderer-crowdfunding/ Any assistance you can offer in spreading the word about this would be greatly appreciated, and help make this cool new feature a reality! So please reshare via twitter/facebook/etc, and if you've got any contacts in the local user groups who might be interested please let them know too... Cheers, 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] GRASS plugin broke only for me?
Dear All, After the upgrading to the GRASS 7.03 I'm not able to have the GRASS plugin working properly. I'm using ubuntu with all software from repo; in particular I'm using: repo 1 for qgis http://qgis.org/ubuntugis/ repo 2 for grass: http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu I noticed that under Plugin -> Grass -> GRASS Option I still have grass 7.0.1 (the last installation) while I'm running GRASS 7.0.3 If I run: GRASS --version I have: grass --version GRASS GIS 7.0.3 Traceback (most recent call last): File "/usr/bin/grass", line 1363, in parse_cmdline() File "/usr/bin/grass", line 1275, in parse_cmdline message('\n' + readfile(gfile("etc", "license"))) File "/usr/bin/grass", line 139, in readfile f = open(path, 'r') IOError: [Errno 2] No such file or directory: '/usr/lib/grass70/etc/license' Could be that it miss the licence file in the package and this cause the plugin GRASS does not recognize GRASS data? In fact if I browse into the GRASS directory I'm not able to add any GRASS layer. If I ask to create e new mapset the QGIS crash Thank to all Pierluigi -- Ing. Pierluigi De Rosa (PhD) Studio Associato GFOSSERVICES Presso CAMPUS Via F.lli Cairoli 25 - 06127 Perugia (PG) fax: 075 7823038 cel: 3497558268 web: www.gfosservices.it skype: pierluigi.derosa ___ 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] very slow on creating a new empty spatialite db
Dear all, I'm experiencing than when I create a new empty spatialite from qgis it takes long time to do it. Here belo is the code I tried: --- # -*- coding: utf-8 -*- from qgis.core import * import qgis.utils from pyspatialite import dbapi2 as db import timeit start = timeit.default_timer() dbase='/home/pierluigi/Scrivania/db.sqlite' conn = db.connect(dbase) cur = conn.cursor() sql = 'SELECT InitSpatialMetadata()' cur.execute(sql) conn.commit() stop = timeit.default_timer() print stop - start --- If i run this code my pc start swapping so much and to prepare the empty db (the total variable) it takes 722.3559 sec or better ABOUT 12 MINUTES!!! Of course the same is if I just save a layer into spatialite format. Why is this happens? Is there a work around for my code to speed up che db creation? I'm running qgis on ubuntu 14.04, qgis 2.8 LTS from launchpad unstable repo. Thanks Pierluigi -- ________ Ing. Pierluigi De Rosa (PhD) Studio Associato GFOSSERVICES Presso CAMPUS Via F.lli Cairoli 25 - 06127 Perugia (PG) fax: 075 7823038 cel: 3497558268 web: www.gfosservices.it skype: pierluigi.derosa ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] calculate distance from two points along line in pyqgis
Dear Gene, Maybe my have not been well explained but I don't need the straight cartesian distance but the distance following the line (as a path). I think the code posted by Giovanni should be fine for my case. I will test it right now. Thanks Pierluigi Il giorno mer, 14/01/2015 alle 00.05 -0800, gene ha scritto: > It is a pure problem of analytical geometry or vector calculus (look at > PyQGIS: geometry, vectors, vector algebra or direction cosines...(in French > <http://www.portailsig.org/content/pyqgis-des-geometries-des-vecteurs-de-l-algebre-vectorielle-ou-des-cosinus-directeurs> > > )) > > Is the line is straight the cartesian distance between two points is given > by > > def distance(point1,point2): > #Theoretical cartesian Euclidean distance between 2 points (x,y) > return math.sqrt((point2.x()-point1.x())**2 + > (point2.y()-point1.y())**2) > > As PyQGIS has the sqrDist function, you can replace by > > def distance(point1,point2): > return math.sqrt(point1.sqrDist(point2)) > > By definition, the point of intersection between two lines lies on the two > lines. It is easy to extract the start point or the end point of the lines > and calculate the distance. > > If you want a confirmation, there are many algorithms in Python to verify > that 3 points are collinear > > If the line has many segments, work at the straight segments level > > > > -- > View this message in context: > http://osgeo-org.1560.x6.nabble.com/calculate-distance-from-two-points-along-line-in-pyqgis-tp5181313p5181376.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 -- Ing. Pierluigi De Rosa (PhD) Studio Associato GFOSSERVICES Presso CAMPUS Via F.lli Cairoli 25 - 06127 Perugia (PG) fax: 075 7823038 cel: 3497558268 web: www.gfosservices.it skype: pierluigi.derosa ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] calculate distance from two points along line in pyqgis
Hi all, I have a line geometry (ALine) and a point(Apoint) belonging to the ALine. Apoint have been evaluated from a second line geometry Bline that cross the Aline using the QgsGeometry intersection function as: Apoint =Bline.intersection(Aline) I need to calculate distance along Aline from the starting point of Aline up to Apoint. In a certain way this problem could be seen as the opposite of function interpolate of QgsGeometry point = geom.interpolate(currentdistance) where it is known the distance from the beginning and it provide the point at specific distance. In my case I have the point but I need the distance. Thanks Pierluigi -- Ing. Pierluigi De Rosa (PhD) Studio Associato GFOSSERVICES ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] Ortho line at specified line distance
Dear all I'm looking for the best way to produce an ortho line to vector line at specified along distance. In past I did the same thing by grass using v.segment and connecting the ortho points nodes. what you suggest as best way to do that? thanks in advance -- Ing. Pierluigi De Rosa (PhD) Studio Associato GFOSSERVICES Via Tilli 58 - 06127 Perugia (PG) tel: 075 7825101 / fax: 075 7823038 cel: 3497558268 web: www.gfosservices.it skype: pierluigi.derosa ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] [OT] - politically correct question
Dear all, Since QGIS was at 1.8 version I used a plugin very useful for me but now the same is to updated to the 2.0 version. I write to the developer asking for un update for version 2.0 and telling him I'm are available to the the necessary work to do that. Unfortunately I didn’t receive any reply from him. What you suggest to do? I can update the code but then I cannot distribuite the code as I'm not the developer? Let me know thanks -- Ing. Pierluigi De Rosa (PhD) Studio Associato GFOSSERVICES Via Tilli 58 - 06127 Perugia (PG) tel: 075 7825101 / fax: 075 7823038 cel: 3497558268 web: www.gfosservices.it skype: pierluigi.derosa ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] addAttribute to memory layer
Thanks Alessando, It was what I was looking for. My error was I didn't updated fields using: vectorlayer.updateFields() Why it is necessary to call it when a field is added into provider? Thanks Pierluigi Il giorno lun, 07/10/2013 alle 10.51 +0200, Alessandro Pasotti ha scritto: > You can try this method: > > https://github.com/elpaso/qgis-geocoding/blob/master/GeoCoding.py#L289 > > -- ________ Ing. Pierluigi De Rosa (PhD) Studio Associato GFOSSERVICES Via Tilli 58 - 06127 Perugia (PG) tel: 075 7825101 / fax: 075 7823038 cel: 3497558268 web: www.gfosservices.it skype: pierluigi.derosa -- ________ Ing. Pierluigi De Rosa (PhD) Studio Associato GFOSSERVICES Via Tilli 58 - 06127 Perugia (PG) tel: 075 7825101 / fax: 075 7823038 cel: 3497558268 web: www.gfosservices.it skype: pierluigi.derosa ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] addAttribute to memory layer
Dear All, I'm converting a plugin with new API but I still doen't figure out how to add attribute to feature. I know it's a stupid question but i think the cookbook is till not updated? http://qgis.org/it/docs/pyqgis_developer_cookbook/vector.html#add-features I tried this code without success: vl = QgsVectorLayer("Point?crs=epsg:4326", 'test', "memory") pr = vl.dataProvider() #~ add fields pr.addAttributes( [QgsField('text', QVariant.String),QgsField('date', QVariant.String)]) fields = vl.pendingFields() feature = QgsFeature(fields) feature[0] = 'some text' Traceback (most recent call last): File "", line 1, in KeyError: '0' Below I attached the code I used in 1.8 vl = QgsVectorLayer("Point?crs=epsg:4326", 'test', "memory") pr = vl.dataProvider() #~ add fields pr.addAttributes( [QgsField('text', QVariant.String),QgsField('date', QVariant.String)]) #~ add features point for pointID in range(len(coordNotes)): fet = QgsFeature() xcoor=float(coordNotes[pointID][0]) ycoor=float(coordNotes[pointID][1]) fet.setGeometry( QgsGeometry.fromPoint(QgsPoint(xcoor,ycoor))) #~ add attribute value fet.addAttribute(0, QVariant( dateNote[pointID][0] )) fet.addAttribute(1, QVariant( dateNote[pointID][1] )) pr.addFeatures( [ fet ] ) #~ update vector layer vl.updateExtents() vl.updateFieldMap() Thanks Pierluigi -- Ing. Pierluigi De Rosa (PhD) Studio Associato GFOSSERVICES Via Tilli 58 - 06127 Perugia (PG) tel: 075 7825101 / fax: 075 7823038 cel: 3497558268 web: www.gfosservices.it skype: pierluigi.derosa <>___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer