You could use the currentText() method to fetch the selected layer in the combo box.
layers = project.layerTreeRoot().children()
selectedLayerName = self.dlg.Isochrones_SelectInputLayer.currentText()
selectedLayer = [l.layer() for l in layers if l.name() == selectedLayerName]
QGIS support for blobs is currently limited to disk-based layers like gpkg and memory layers, not databases. (See Load PostGIS Layer with BLOB and use the form widget for binary fields (QGIS 3.6) not working )
If you can live with this limitation, or if blob support is later expanded to additional providers, see my question and answer here: Display photo ...
Found a solution although its a little rough and ready - however works for any shape polygon which is what I needed.
Vector - research tools - regular points
Select input extent layer, set spacing interval etc...
Then once ran, clipped to points just within the polygon.
I think, you should use toProperty() method, which returns QgsProperty. Then you can use value() or valueAs***() methods of QgsProperty to get value of defined expression. Or you can get raw expression string with expressionString() method. See docs for QgsProperty.
value() and valueAs***() returns tuple where first element is actual value and ...
You're right. QComboBox objects allow only single selection because they don't have ExtendedSelection option (as QListWidget objects) for activating multiple selection. However, you can also use a QTableWidget object whose ExtendedSelection option is already activated by default. In following code you have an example.
from PyQt5.QtCore import Qt
It is possible and you do not need a plugin for it (Assuming you are using QGIS3)
Zoom to an area covering where you want the points
Then, Go to Vector -> Research tools -> Regular points
Set input extent to Use Canvas extent and set point spacing to 1
You will probably get more points than you want / need, so for next step select the ...
As The Qt Resource System
the main reason of using resource file is to avoid the risk of losing the files.
pyrcc5 generates all in one binary-like string which contains all resource files defined in .qrc file, and adds that string to .py file (in this case, resources.py), then you import that module (from .resources import * or from ...
pluginname/ top-level package
__init__.py initialize the package
dialogs/ sub module
You have to specify explicitly sub module in the same package using .(dot).
Use .dialogs.select_feature_dialog (Relative import):
The Resource Sharing plugin version 0.6.0 (available since 4 December 2018) was the first version to support QGIS 3. Some issues (https://github.com/akbargumbira/qgis_resources_sharing/issues), but it is still quite useful for sharing your resources with the community.
As of today (7 February 2020), there has been an additional update (v0.7.0), which ...
I encountered this problem. Some processing tools worked in QGIS 3.8, but doesn't work in QGIS 3.4.
I don't know the reason, but changing native word into qgis in all processing.run ("native:tool_name", ...) solved the problem. (native:intersection -> qgis:intersection)
Move self.pushButton_2.clicked.connect(self.OpenQgis) outside the loop otherwise you are attaching to the button multiple events.
It causes your "only" click to emit multiple calls and hence add multiple layers.
The most convenient solution for users of the plugin is to bundle wheel inside your plugin. Download wheel, place it in your plugin folder and import it from there.
this_dir = os.path.dirname(os.path.realpath(__file__))
path = os.path.join(this_dir, 'elevation-x.y.z-py2.py3-...
While building a plugin for QGIS using Plugin Builder, if you get ModuleNotFoundError: No module named '... .resources' error after running Makefile, you should first check if resources.py exists in the folder (source folder) created by Plugin Builder. If it does, copy that file into your plugin folder in QGIS plugin folder (target folder).
If there is no ...
You can use Qt.MatchContains flag as filter mode.
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QCompleter
completer = QCompleter()
For further information: Filter Modes for QCompleter.
The problem, I think is that you lost the reference to the QgsVectorLayer outside the function, the solution is to define self.layers, see below :
def __init__(self, parent=None):
self.canvas = QgsMapCanvas()
self.layers = 
Try specifying the CRS when you construct your QgsVectorLayer object e.g.
v_layer = QgsVectorLayer('LineString?crs=epsg:4326', 'line', 'memory')
Unfortunately, you don't show us what objects you are passing to your drawLine() function as the line_start and line_end arguments, however running the code below which directly creates QgsPoint() objects for the ...
Version 0.9.0 of the Resource Sharing plugin was made available on http://plugins.qgis.org today (https://plugins.qgis.org/plugins/qgis_resource_sharing), and the good news is that it includes support for R script collections.
See https://gis.stackexchange.com/a/341008/22646 for more details, and for information about available collections and ...
As GabrielDeLuca pointed out - the problem seems to be related to invalid geometries being created by the plugin. Changing the invalid features filtering did not really help, but when I ran the interpolation on a slightly smaller subset of my input points, everything worked fine.
I guess the reason for the error was the test extent that I have selected.
Yes, the WKT plugin allows you to do that.
Just paste each geometry in a new line:
Which loads all 3 geometries as 3 layers:
If you paste geometries of the same type, they will be created in the same layer, unless you check "Create a new layer for every geometry."
I have tested the plugin and it is working fine in my machine.
One common way to download (SRTM among other) data is searching it in Earth Explorer site.
All the information about how to use the site is in their Help page.
If you want to download just that image, you can do it from the Download link provided in the following page:
You've created a scratch layer that's MULTIPOLYGON type, but you're saving to a POLYGON type, which is causing your problem as for some reason these aren't compatible. This typically means you have polygons with inner holes or rings which then feature additional polygons inside the ring, or are storing all features with the same contour as one giant, ...
I expect it should be possible, but I suspect it is overkill for what you are describing.
Adding QGIS to your workflow is beneficial when you either need to create quality visual maps, or when QGIS/PyQGIS is a useful coordinator for a more complex geospatial workflow.
It's not 100% clear from your question, but it sounds as if your core, i.e. master, ...
In this case I found that I can use setTransformOriginPoint before my setRotation line to specify the point of rotation.
I thought it should be half hight, width bit that spun it off centre (code below)
Check out this answer from several years ago - you will need to use the GRASS toolset, but using v.clean correctly should still give you the result you require.
Is there an open source tool to planarize graphs?
The error is not in the scripts themselves but in the structure created.
Having a folder called myplugin and a file also called myplugin. QGIS cannot distinguish between them when reloading.
When changing the script name, the reload worked correctly.
You may also use the Snap geometries to layer processing tool:
This algorithm snaps the geometries in a layer. Snapping can be done
either to the geometries from another layer, or to geometries within
the same layer.
I used both the location provider and Autocomplete API provided by https://github.com/location-iq/leaflet-geocoder. This autocomplete feature utilises a Search API that returns place predictions in response to an HTTP request. The request specifies a textual search string and optional geographic bounds and works as expected.