Since version 3, QgsMapLayerRegistry funcionalities have been moved to QgsProject: https://qgis.org/api/api_break.html
Update for QGIS3.x:
from qgis.core import QgsProject
names = [layer.name() for ...
To get field names with fields() method or other field properties (length, type, comment, ...) you can use:
field_names = [field.name() for field in layer.fields()]
# ['id', 'attr1', 'attr2', 'attr3']
Just to clarify, private/hidden layers/groups will not appear in the Layers Panel, but they can still be seen in the canvas or used in joins/relations with other layers.
Native approach (QGIS API)
The following code works for me from both the Python Console and plugin. It takes the features from the source input layer and copies the attributes to a memory layer (in this case, a polygon layer ...
To get all features of a layer by the layer name you do not need to activate it. Just use
name = 'counties'
layer = QgsProject.instance().mapLayersByName( name )
poles = layer.getFeatures()
In ol3 version 3.10.0 things have changed. So is more clear than older versions but still more complicated than ol2.
So for TILE (ol.layer.Tile) layers your code snip should look like:
//declare the ...
I don't think there is a way to do this in the map canvas itself. The labels will always be on top at least in QGIS 2.x.
But for the print composer, you can work with two maps. They should be in the ...
Yes, you can use the feature.set()option which Feature Overview covers with these examples:
// Make a feature and set some properties.
var feature = ee.Feature(ee.Geometry.Point([-122.22599, 37.17605]...
In the Layer pannel, there is an icon in form of an eye : Manage Map Themes (documentation) :
By clicking on it, you can see the option for display / mask the selected layers.
You can also go to the ...
To extend the great solution by @Kadir Şahbaz, you could do something like this to get a count per group:
p = QgsProject.instance()
root = p.layerTreeRoot()
view = iface.layerTreeView()
Create Layer From Selected Features DOES NOT create a DYNAMIC layer. The resulting layer is not dynamic at all. It is based on an FIDset.
If you change the source data, the FIDs will change and your ...
I recommend the Vector Bender plugin for QGIS.
I tried it and it works fine and is user friendly.
Depending on amount of pair of points that you define, you can either do:
translations: translation ...