Hot answers tagged

4

cur.execute(sql) rows = cur.fetchall() for row in rows: print row or for one record: row = cur.fetchone() print row


3

I would use a Line Edit widget. Inside your run() function put something like: self.selectedLayer = self.iface.activeLayer() # Adjust this to your situation self.selectedLayer.selectionChanged.connect( self.printSelectedArea ) Then define your printSelectedArea function: def printSelectedArea( self ): area=0 for f in ...


2

Okaaayy I found ! the problem comes from the Qgis browser... the thing where you can explore your folders and stuff... If the folder you want to delete is opened in there it wont delete it... so I just need to find a way to ensure that the folder is not opened in the browser !


2

Based on Detlev's answer, I have developed a QGIS plugin which should allow others to solve similar problems easily. It is available in the official QGIS plugins repository and can be found in the QGIS menu: Plugins / Manage and Install Plugins... and search for Disconnected Islands. http://plugins.qgis.org/plugins/disconnected-islands/ This plugin runs ...


2

In my opinion, a much easier way to use an "in house" plugin is to place a copy in the following directory: C:\OSGeo4W\apps\qgis\python\plugins Also within this directory you will see other plugins that are installed as core plugins that come with the OSGEO4W download of QGIS. After placing a copy of your custom plugin into this directory, be sure to go ...


2

In 2.12 it (Cartogram plugin version: 1.0.0, on windows 10) works fine, just did a check.You have to wait a few seconds...


2

These two code statements will provide the table path to the db name: print iface.activeLayer().dataProvider().dataSourceUri().split('|')[0] or print lyr.dataProvider().dataSourceUri().split('|')[0]


2

It's generally discouraged to write c++ QGIS plugins, for the following reasons: They can't be distributed via the plugin library (only python plugins with no binary dependencies are accepted) The c++ API is not stable between QGIS releases (including point releases), so you need to update and recompile c++ plugins for each QGIS version used. (In contrast, ...


2

It should be in the Web menu (and for me, in the toolbar highlighed by the red circle): Also used QGIS 2.14.1-Essen.


2

You could put more than one geometry onto each other. Then you can have your full set of rows with your history. And in case of the same geometry but different usage you have two times the same geometry "above" each other. That should be like a relate.


2

After pansharpening the satellite images I had to convert to WGS84 coordinate system. The first attempt caused something to go wrong in the reprojected band 2 GeoTIFF file. When I performed the reprojection a second time, the band 2 was listed in the "Clip Multipple Rasters" list. Obviously a glitch of some sorts.


1

import os from PyQt4 import QtGui, uic from PyQt4.QtCore import pyqtSignal FORM_CLASS, _ = uic.loadUiType(os.path.join( os.path.dirname(__file__), 'my_dockwidget_base.ui')) class myDockWidget(QtGui.QDockWidget, FORM_CLASS): closingPlugin = pyqtSignal() def __init__(self, parent=None): """Constructor.""" super(myDockWidget, ...


1

Use the GroupStats plugin, which works like an Excel pivot table and allows you to calculate statistics, such as for length in your case, for various combinations of groups.


1

Just go to Plugins, Manage and Install Plugins, Settings. Enable experimental plugins. Go to all, search for ArcGIS and install the plugin. A ArcMap icon will appear on the Manage Layers Toolbar.


1

There is a workaround using the processing.runalg() method, described in this post: Using in-memory vector layer with QGIS processing / SEXTANTE. EDIT: the script I copied was for vector clipping (not raster). I replaced it by GDAL's Clip raster by extent algorithm which does precisely what you want. You need to use the path to your raster as an input (and ...


1

I would add a function which populates the year comboBox each time a feature is selected. For this you'll need to add a line in init to call the function: self.dlg.comboBoxName.activated.connect(self.populate_years()) And then something like: def populate_years(self): years = [] layerName = str(self.dlg.comboBox.currentText()) ...


1

If you select some features from map canvas, the following signal is emitted: selectionChanged So you just need to create function which calculate area and connect it to this signal.


1

QGIS has a plugin managment tool. On the menu, you can scroll in a list containing all of your plugin. You can uninstall the one that is problematic.


1

In my case, I have found the mistake was not because the number of layers (shp file), but because the name of an attribute in some layers was improperly used (has space between words). This time, I can create webmap using QGIS2WEB.


1

It's the plugin processing. QGIS 2.14 comes with a mechanism that deactivates plugins if they did not successfully load on QGIS startup. This points out a potential problem in the plugin. Save your work and try to re-enable the plugin and if it fails to load again, file an issue (for the plugin, not for QGIS). In its first version (2.14.0) there is a ...



Only top voted, non community-wiki answers of a minimum length are eligible