Skip to main content

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
0 votes
1 answer
30 views

QGIS "Render Layers as a Group" Ignores Scale-Dependent Visibility

In QGIS 3.40, I've grouped several vector background mapping layers (OS Open Zoomstack data) for easier management. Individual layers (e.g., railway station points) are configured with scale-dependent ...
davehughes87's user avatar
0 votes
1 answer
69 views

Copy layer group from one project to another with PyQGIS

Using QGIS 3.8, is there anyway to copy a layer group (and its subgroups) from project1.qgz to project2.qgz? I'm trying to write an script that adds a layer group (with several layers and group layers ...
pfrud's user avatar
  • 81
2 votes
1 answer
150 views

Applying specific styling to group layers in the LayerList Widget in ArcGIS Maps SDK for JavaScript

Using ArcGIS Maps SDK for JavaScript 4.24, I would like to change the formatting of Group Layers within the LayerList Widget, such that the group layers can be immediately distinguished from non-group ...
Stephen Lead's user avatar
  • 21.2k
1 vote
1 answer
63 views

Layers corrupted after saving, closing and opening of QGIS project with PyQGIS

Using a Python script, I create a layer from a CSV file and then write it out to a gpkg file. I then create a group in the layer tree, load it in the gpkg file and add it as a child of the group. This ...
John_nz's user avatar
  • 51
1 vote
1 answer
254 views

How to programmatically access Trace network layer results when using NETWORK_LAYERS result type in a stand-alone Python script?

I have a stand-alone Python script that runs a Connected Trace on a Trace Network. This is a re-write of an existing script that runs a trace on a Geometric Network. The script will be published as ...
Dan's user avatar
  • 1,100
2 votes
1 answer
208 views

How to move a layer to a group using Python code in ArcGIS Pro?

I am trying to move a layer to a group using python code. Both the layer and the group are in the current/same map in ArcGIS Pro. I have the following code (the layer to be moved to the group "...
HKN's user avatar
  • 45
5 votes
1 answer
212 views

Cloning the map layer using PyQGIS

I want to clone my generated memory layer and apply different filters and symbology. The clone is visible in the layer tree, but doesn't show up in the canvas. What am I doing wrong? uri = f'point?crs=...
Redoute's user avatar
  • 2,242
4 votes
1 answer
464 views

Move an existing layer into a group layer using ArcPy in ArcGIS Pro

I have a map object and I am trying to move an existing layer from that map object into a newly created group layer in the same map object. aprx = arcpy.mp.ArcGISProject("Current") mp = aprx....
Kat's user avatar
  • 311
1 vote
1 answer
248 views

Remove layers from a group and update LayerSwitcher with OpenLayers?

I have a layer group in OpenLayers that initializes empty. This group is added in a layer switcher var group_search = new ol.layer.Group({ title: 'Search', fold: 'open', layers: [] }); map.addLayer(...
Andreia Gusmao's user avatar
1 vote
1 answer
62 views

Combining two rasters at different resolutions with MapServer as a single WMS layer

I am trying "Join" two rasters with MapServer 7.6.4 so that they appear as a single layer on a WMS service, I have tried the wms_layer_group and GROUP but without luck. | 2 images one high ...
Jorge Mendes's user avatar
18 votes
2 answers
904 views

Showing the number of currently selected layers in QGIS

Although this should seem to be very straightforward, I cannot find out how to see the number of layers I have currently selected in QGIS. For example, in the example below I want to see somewhere in ...
Sytze's user avatar
  • 792
0 votes
1 answer
279 views

ArcPy command to remove empty layers that are grouped

I have a script that works for MXD with ungrouped layers. How can I change this so it works if there are groups of layers? I have an MXD template with many layers & groups. The underlaying file ...
Eifa's user avatar
  • 1
2 votes
1 answer
84 views

Viewing memory layers in group with PyQGIS

I'm writing a plugin for QGIS and given a layer (self.layer_comuni) from this I extrapolate an indeterminate number of layers depending on the correspondence of the values of the mercato_comuni list ...
Wolverine's user avatar
5 votes
1 answer
257 views

Getting active group with PyQGIS

In PyQGIS we can obtain the active (currently selected) layer with >>> iface.activeLayer() <QgsRasterLayer: '007' (gdal)> With a group selected this returns None (?). QgsInterface does ...
Jochen Schwarze's user avatar
4 votes
2 answers
2k views

Adding output layers of QGIS processing scripts to group using PyQGIS

I have a QGIS Python processing scripts that return multiple rasters. I want to return them to a group named 'Aligned'. There is nothing in the context.addLayerToLoadOnCompletion() function to specify ...
ar-siddiqui's user avatar
  • 1,830
2 votes
1 answer
308 views

Enabling the "Render Layers as a Group" option in QGIS through python

I have written a simple python function that loads several existing shapefile layers into a new group in QGIS 3.28. I would like to extend this function to also automatically enable the "Render ...
davehughes87's user avatar
1 vote
1 answer
1k views

Why is GeoServer 'Layer Groups' not opening?

I want to create a layer group in GeoServer, but when I click on the layer group I get the error below. I am logged in as an admin, I'm not sure if this has to do with my setup? An error occurred ...
Magali Gonçalves's user avatar
8 votes
2 answers
2k views

Sorting layers by name in one specific group of QGIS layer tree

I'd like to reorder the layers within ONE specific group of the TOC alphabetically by layer name, but without reordering the top level layers or the layers of other groups. I found the following ...
jaysigg's user avatar
  • 507
3 votes
1 answer
351 views

Renaming group layer using ArcPy with ArcGIS Pro

How do I rename a group layer in ArcGIS Pro using ArcPy? In ArcMap I can do so thus: groupLayer = arcpy.mapping.Layer(r"Path to grouplayer.lyr")# empty group layer as template groupLayer....
wunderkind's user avatar
2 votes
1 answer
178 views

Creating event in PyQGIS that notices that group of layers is selected

I have these groups of layers with their layers inside in QGIS: I have an event in PyQGIS that notices when I select a layer like RODAL or MONTE: iface.layerTreeView().currentLayerChanged.connect(...
Andrés Rodríguez's user avatar
2 votes
0 answers
368 views

Creating layer in group-layer in QGIS Graphical Modeler

I want the layers created during a graphic modeler process be stored in a specific layer group. I tried a bunch of stuff, based on clone-move-delete, node_root, layertreelayer... Maybe in alg_params ...
Festisat's user avatar
10 votes
1 answer
3k views

Selecting subgroup in Layers panel using PyQGIS

I can select a group layer (for example C) using the following script. But I can only select groups in root level (A or C). I am struggling to select subgroups. I play with the script, but no success. ...
Kadir Şahbaz's user avatar
1 vote
1 answer
788 views

Mapbox GL JS Equivalent to Leaflet LayerGroup?

Does anybody know of an equivalent to the Leaflet L.layerGroup in Mapbox GL JS? I can do this in leaflet: var layerGroup = L.layerGroup().addTo(map); And then if I want to add, say, a marker to the ...
SteepAtticStairs's user avatar
12 votes
4 answers
9k views

Moving layers in the Layer Order Panel using PyQGIS

The following is a simple setup containing a group with three layers. The code I use adds a new layer at the end of this group: root = QgsProject.instance().layerTreeRoot() group = root.findGroup('...
Joseph's user avatar
  • 76.3k
1 vote
0 answers
182 views

Group by multiple columns in QGIS array

I'm looking to create a figure with multiple rule-based symbologies. A graduated range within a category within a main category. The only way I think that's possible is by adding categories, ranges to ...
envsci_melb's user avatar
0 votes
1 answer
77 views

Get print composer to acknowledge the "Lock Layers" option when using the "Render Layers as a Group" option

I have shapefiles and rasters loaded into a QGIS workspace (3.30, but this issue doesn't seem to be version specific from my experience). I've grouped some of the vector layers and checked the "...
davehughes87's user avatar
1 vote
0 answers
104 views

C# - Add GroupLayer to Active Map (ArcGIS Pro)

I'm trying to add a groupLayer to active map using C# and ArcGIS Pro. Devloping a plugin. This is my sample code or what I've tried so far: Esri.ArcGISRuntime.Mapping.Map myMap = new Esri....
Luiz's user avatar
  • 11
2 votes
0 answers
347 views

Exporting layer tree in QGIS

I need to create a layer tree for other user researchers to use. In the final dataset there will be ~20 sub-groups, each with dozens of layers. (It's possible that this isn't the best way to do it -- ...
user670416's user avatar
0 votes
0 answers
136 views

MapServer wms_layer_group, set title

We want to group wms layers in mapfiles and give the group a title that is different from the name. Until now we did this with GROUP and wms_group_title, but GROUP is deprecated and we want to use &...
Vera's user avatar
  • 11
3 votes
1 answer
1k views

Getting layer within a specific group using PyQGIS [closed]

I have two groups with unique names, which contain layers using identical names, e.g.: Group 1 Layer A Group 2 Layer A Is there a smart way to set the active layer to specifically Layer A from e.g....
Karin Drenck's user avatar
2 votes
2 answers
2k views

Iterating over features within Group Layer that will be identified with Wildcard using ModelBuilder of ArcGIS Pro

In the ModelBuilder of ArcGIS Pro 2.8.1, using Iterate Layers, I want to iterate over features that are in a group layer. It seems like I should be able to identify this group layer by using a ...
sparky's user avatar
  • 450
0 votes
1 answer
650 views

Adding multiple feature classes (all within file geodatabase) to group layer using ArcPy with ArcGIS Pro

I am currently trying to add all the feature classes contained within a gdb to a group layer in ArcGIS Pro via a script. I have however not managed to add more than one single feature class at a time. ...
Sineik's user avatar
  • 27
1 vote
2 answers
732 views

Layer to KML using ArcGIS Pro doesn't show all points [closed]

I'm using ArcGIS Pro, and I am trying to convert a group of layer (both points) to KML. When I make the KML and open it it doesn't show all the points!
Hoda's user avatar
  • 11
0 votes
0 answers
40 views

GeoServer GroupLayer GetFeatureInfo returns wrong layer feature

I'm currently facing an issue with GeoServer and its GroupLayer functionality. I have created a GroupLayer named confini containing three layers: tutorial:Reg01012023_WGS84 (Regions), tutorial:...
stefano_rizzo's user avatar
8 votes
3 answers
8k views

Adding layer to group in layers panel using PyQGIS? [duplicate]

I am trying to add a group to the layer panel, then place a vector layer (vectorLayer) into this group from a python script. The code I am using is: groupName="test group" root = QgsProject.instance()...
the-jfry's user avatar
  • 125
14 votes
3 answers
8k views

Adding layer to group using PyQGIS

I am trying to add new layers into a specific group which I can get to work if I know the index, but how can I get Python to find the index of a group so it can load the new layer into the group ...
Seth Loader's user avatar
3 votes
1 answer
5k views

.on("load") event for layer groups in Leaflet

I have used Leaflet's ImageOverlay to load various image layers onto a Leaflet map div (L.map). The size of the layer files can vary greatly. So some layers load very quickly while others can take a ...
kykong's user avatar
  • 93
10 votes
3 answers
4k views

Removing all layers from group using PyQGIS

I want to remove all layers from a distinct group. root = QgsProject.instance().layerTreeRoot() the_group = root.findGroup("my_group") parentGroup = the_group.parent() I think I have to ...
Stefan's user avatar
  • 4,474
2 votes
1 answer
1k views

Identifying layers by grouping using ArcPy

I have a number of layers that I want to manipulate with ArcPy. On my ArcGIS Pro map I have them under a group layer. To deal with them, I have been picking them by name as follows: for theLayer in ...
Maxcot's user avatar
  • 265
7 votes
4 answers
17k views

Dynamically add layer(s) to Layer Group

I have an Openlayers 3 app and users can retrieve stored routes from a web service and display them on a map. Currently each route is added to the top of the index but I'd like them to be inserted ...
dvmac01's user avatar
  • 1,065
2 votes
1 answer
355 views

Copy styles from many layers

I am working with QGIS 3.4 Is there a way to easily copy the styles from one group of layers to another group of layers with the same names? The outcome should be that layers that share the same name,...
GeofA's user avatar
  • 21
0 votes
1 answer
63 views

Using ReplaceDataSource with group layers and ArcPy with ArcMap

I have a script to replace the data source on layer files in an mxd based on a geodatabase input from the user and a feature class with a matching name to the layer. This script works as intended as ...
serena's user avatar
  • 13
2 votes
1 answer
2k views

ArcPy Select (Highlight) All Features In a Specific Group Layer in Current Map [closed]

I am using ArcGIS 10.4.1. Can you let me know how I can Select/Highlight (I am not going to run any attribute query against the layer and this is just for visualization) all features listed under one ...
user1106951's user avatar
  • 1,498
-1 votes
1 answer
203 views

Making Grouped Layers in ModelBuilder using ArcMap

I started using ArcMap 10.4 just a few weeks ago, I've started to get a handle on the ModelBuilder however I can't seem to make the layers I export be automatically grouped. So far this is the most ...
Sam R's user avatar
  • 1
13 votes
2 answers
9k views

Adding layer group using PyQGIS? [closed]

How can I create a new group in the layer manager using python code?
malagueff's user avatar
  • 159
0 votes
0 answers
36 views

Group Created in QGIS Disappears When QGIS is Reopened

I have a situation where a newly created group layer (with various geometry types that are not scratch or temporary layers) disappears when re-opened. In some cases, it occurs right away, other times ...
Demandred's user avatar
2 votes
1 answer
516 views

Layer Group cannot be added into QGIS

I am having a problem with adding a layer group into QGIS, where upon making a connection to the server in QGIS, the layer group does not appear. I see only the layers that make up that layer group. ...
Marian's user avatar
  • 21
9 votes
1 answer
620 views

Programmatically select a GROUP node using PyQGIS

I have seen ways to programmatically select a current layer using QgsLayerTreeView().setCurrentLayer() but I cannot find a way to change the group selection. Does anyone have any tricks/hacks that I ...
QGisNoob's user avatar
2 votes
0 answers
115 views

QGIS Group Layer Variables

QGIS Group Layers don't have properties, probably because of that there also doesn't exist the possibility to define variables for Group layers. I use Project variables and Layer variables but also ...
geraldo's user avatar
  • 1,000
5 votes
2 answers
1k views

PyQGIS toggle group visibility (and recursively subsub...group visibility)

I would like to set visibility of a layer group and all of its children (and grand-children and so on...) using PyQGIS (QGIS 2.14.1). Assume the groups name is g0 with subgroups g0[1...n] and subsub.....
Jochen Schwarze's user avatar