New answers tagged

0

Maybe,your questions for this? from PyQt4.QtCore import * from PyQt4.QtXml import * layers =iface.legendInterface().layers() for layer in layers: myFile = "PATH_TO_COMPOSER_TEMPLATE" myTemplateFile = file(myFile, 'rt') myTemplateContent = myTemplateFile.read() myTemplateFile.close() myDocument = QDomDocument() ...


2

The error occurrs because the plugin does not filter out Raster layers from the QGIS ToC and lists them in its own GUI. The plugin should only deal with Vector layers, since it acts on vector geometries. I've just sent a pull request to the plugin's author with code to fix this problem. If you don't want to wait until the author releases a new Simplipy ...


0

I think i cracked it. I get skewed rater if my Project CRS is set up as Slovenian National Grid. If i set it up as WGS84 and import Tif Raster it gives me error and sets up raster CRS to WGS84. That puts tif in the middle of Atlantic. But if i then correct project CRS back to Slovenian National Grid and also Raster CRS - Raster is not skewed and in right ...


2

QMS is certainly installable using Ubuntu 14.04 and QGIS 2.14.1 so I suspect your issue is the age of your QGIS install if it really is 2.0.


0

Here ist the project repository at github: https://github.com/vinayan/RectOvalDigitPlugin . You should raise the issue there.


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 ...


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, ...


0

Guess the answer was simpler than I thought. Had to insert everything into the run(self) function. So the following code works: def run(self): def test_print(): print 'It works!' self.dockwidget.pushButton.clicked.connect(test_print)


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.


0

I would probably do the following: Vector > Data Management Tools > Split Vector Layer This splits up your shapefile to 4 separate shapefiles each with a unique category when you select the Unique ID field Vector > Analysis Tools > Sum Line Lengths Then run this tool for each of the 4 shapefiles and your polygon shapefile to get the sum for ...


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.


0

this would be a great feature. In my dreams, I could also double-click on a raster cell and set its value... SAGA GIS can render cells like this. These instructions are for SAGA GIS 2.2.6 . There have been a few menu changes in recent versions of SAGA, but this is also possible in older versions. Import your raster using Geoprocessing > File > Grid > ...


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

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.


0

You can find the tool inside the SAGA toolbox. Open the toolbox and search "Resampling". It has both scale up and down algorithms.


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 ...


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

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]


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 !


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()) ...


0

This is still a problem in QGIS ESSEN 2.14.0 I normally use two screens when I georeference and it seem that QGIS remember this somehow. To find my georeference window I have to change my setting to "extend this displays" despite not having a second screen hooked up. Then go fishing for the window to drag it into you working screen.


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, ...


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.


4

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


0

99% is that you upgraded qgis having an old installed version of Processing. Processing plugin is a core plugin and it's always availabe as core plugin, but it can be also installed via plugin manager (so intalled in $HOME/.qgis2/python/plugins/) so upgrade current core version. try to: 1) de install processing plugin (if this is allowed means you have an ...


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.


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 ...



Top 50 recent answers are included