Tag Info

Hot answers tagged

4

If I got you right, you can use the SIGNAL selectionChanged from your vector layer and connect it to your other function (which must accept an argument to receive selected features' ids). For example, load a vector layer to QGIS, activate it in the ToC and run the following code in the QGIS Python console. You should see the function is running after a new ...


3

You can activate the diagram overlay for a vector layer in layer properties > diagrams: As a core plugin it is included in QGIS. You can find more information here: How to draw bar diagrams on the map?


2

In an email exchange with Radim Blazek in the grass-user mailing list he explained: QGis from OSGeo4Win is compiled with GRASS 6, you cannot get it working with GRASS 7. Reinstalling will not help. The provider and the plugin has first to be fixed to support build with both GRASS 6 and GRASS 7. This is in the first package of proposed upgrade: ...


2

If you have installed a 64-bit version of QGIS on Windows and you find that Personal GeoDatabases (*.mdb) no longer work for you, then this solution might apply; I'm on QGIS 2.8.1 rather than 2.6, but I assume that the issue and thus the solution is the same. The underlying issue relates to this GDAL bug: Problem reading MDBs (64-bit) Step 1 Download the ...


2

You should create new custom CRS and assign it to your layer(s). This quick and dirty approach worked for me after reading all the posts arround here. I use QGIS 2.8.1 and metric system, as I live in Central Europe: import Open Layer (in my case, Google Hybrid) import your data (in my case, our Municipality Border) right click on your data layer and ...


2

You can do something like this (steps explained as comments): #Get the layer reference. In this example I'll use the current layer: cLayer = iface.mapCanvas().currentLayer() #Build the expression. STATE and CITY are field names; # state and city represent the values from your combo boxes expr = QgsExpression( "\"STATE\"='" + state + "' AND \"CITY\"='"+ ...


2

This is not exactly the answer to your question, but rather a suggestion. For RS, I would not use QGIS as a core software, because it is more oriented for GIS (even if it includes many tools). I suggest that you have a look at GRASS 7 (the new GUI is a true step forward). I don't have a look of experience because it is new, but I got some feedback and I've ...


2

1: The legend table has the granularity of the layer table. So: one entry in the table per layer. If you define an entry in legend_ico and legend_exp only the first line in the attribute table will be used. 2: legend_ico could contain one path like 'pictures/legend_1.jpg' with a local path for your image. You need to create the image either by hand or place ...


2

The best practice is to use a resource.qrc file and compile that in into a resource_rc.py file using pyrcc4. pyrcc4 ships in the QGIS folder run OSGeo4w.bat to get access to it. pyrcc4 -o resources_rc.py resource.qrc In your Python code you then do: import resources_rc icon = QIcon("Identity.png")


2

Non-valid layers are most of the times due to a wrong QGIS prefix definition. Please try with: qgis_prefix="C:\\Program Files\\QGIS Wiena\\apps\\qgis" QgsApplication.setPrefixPath(qgis_prefix, True) Which should go right before this line: QgsApplication.initQgis() Now your tested layers should be valid.


2

You can do that in this way, from the QGIS Python console: from PyQt4.QtGui import QToolBar iface.mainWindow().findChild(QToolBar,'mLabelToolBar').setVisible(False) iface.mainWindow().findChild(QToolBar,'mLayerToolBar').setVisible(False) I got the tool bar names (e.g., mLabelToolBar and mLayerToolBar) from Settings->Customization...->Toolbars. Check ...


2

Keep things simple, you don't need a special function selectedfeatures here, you can do everything at once (try your script in the Python console before). 1) you don't need the Valtestand state_and_cities variables: layer = iface.activeLayer() idx = layer.fieldNameIndex('name') idx1 = feature.fieldNameIndex('state') for feature in layer.selectedFeatures(): ...


1

You could try using pyinstaller: https://github.com/pyinstaller/pyinstaller/wiki It will require some tweeking to get all the dependencies.


1

Without creating a QT application in the main function I directly called the function that initiates the QGIS libraries. That was the problem. Now it got solved after making changes.


1

I did a quick glance at the code for the tool. It appears that default/feet choice is to specify a fixed conversion between feet and meters. This would make sense, because as I mentioned earlier in the context of metes-and-bounds you're usually using one of those units (or something archaic like chains or rods). But line 189 of the source code is just a ...


1

Unfortunately this is an issue in the current version. We created this function and it worked well (at least on my linux notebook) and it went down some months ago. You can contribute to this issue Nevertheless you can reproject any raster to EPSG 4326, translate it to jpg and embed it by hand in your webmap project. I solved this issue now and you can ...


1

Here are the screen shots of the final work. The webpage and part of the html code which i had to alter Thanks so much for the help.


1

I am not sure if this help you since this is for python. Why not add the action to attributes toolBar. attributeToolBar = self.iface.mainWindow().findChild(QToolBar,'mattributeToolBar') action = QtGui.QAction(parent) attributeToolBar.addAction(action)


1

I guess you need to connect the SIGNAL selectionChanged when your plugin is opened and disconnect it when your plugin is closed. For example, you could set the connection at the beggining of the run method and disconnect it at the end of the run method. This way, when your plugin is not running, you won't get QGIS showing the information box you mentioned.



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