Questions tagged [layers]
A layer is a collection of information. It contains specific elements of a gis in a specific presentation method (e.g raster or vector layer). Layers can be edited separately in order to create individual topics for a map.
2,298
questions
113
votes
5
answers
292k
views
Merging multiple vector layers to one layer using QGIS
I've imported several shapefiles which where exported from a Mapinfo .tab. Several .tab-files are imported resulting in 20+ layers.
Afterwards I want to export it to GeoJSON; but I'm reluctant to ...
66
votes
3
answers
95k
views
Layers with same coordinate system should align/overlap in ArcMap but do not?
I put 4 different layers into my ArcMap document, but only one of them will show up on the map! I should be seeing the other 3 layers as well. When I do a Zoom to layer, I can see one layer, but I ...
52
votes
5
answers
36k
views
Change style properties of several layers simultaneously?
I'm working on bulk data. I have a few hundred GeoTIFF images imported into a QGIS project, and I'd like to modify their layer properties - things like the no-data-value, transparency of certain pixel ...
40
votes
10
answers
53k
views
Georeferencing vector layer with control points using QGIS?
I have a non-georeferenced vector layer that I need to be georeferenced. With raster layers the task is easy and straightforward, but I have no idea what should I do with my vector layer. I have a few ...
39
votes
5
answers
28k
views
Iterating over map layers using PyQGIS
I'm having trouble figuring out how to iterate over map layers. I can access the currently highlighted layer in the table of contents via iface.activeLayer() but I want my code to operate on all ...
37
votes
6
answers
41k
views
Difference between map layer and spatial dataset (e.g. feature class, shapefile)?
What is the difference between a feature class and a feature layer?
To me they seem very similar in concept.
34
votes
0
answers
3k
views
Leaflet v1 plugin: layer control for ungrouped, grouped, and nested-grouped layers
I need a Leaflet plugin which extends L.Control.Layers. I have the following requirements:
works with Leaflet 1.x
handles ungrouped layers alongside grouped ones
handles nested layer groups
does not ...
33
votes
2
answers
25k
views
Filtering features in other layers of QGIS Atlas
I'm trying to use the QGIS Atlas tools to build student 'scattermaps', i.e. display the school and the students that attend that school, for 215 schools.
The schools layer is the coverage layer, and ...
32
votes
1
answer
45k
views
Getting layer by name in PyQGIS
I have a plugin which finds buffer for list of cities, provided the distance. The state and city names are taken from the attribute table and gets filtered accordingly. What I want is my plugin should ...
29
votes
3
answers
7k
views
Organization and tidiness of multiple copies of layers? [closed]
Back in the days when I was in the university I had a "Organization and tidiness" problem – I was unorganized and kept my layers in different folders without distinct names and hence had multiple ...
27
votes
5
answers
24k
views
Getting path of project or layer file in PyQGIS
I am generating new raster files from vector layers on a project. I would like to save them in the same directory as the project or layer files.
How do I find this path using PyQGIS?
27
votes
6
answers
51k
views
Changing data source for all layers in MXD?
I have an MXD. It connects to about 30 layers in one of our SDE databases. I want to change the SDE database they connect to.
Is there a way to do this without having to right-click every layer ...
26
votes
2
answers
36k
views
Setting layer transparency in QGIS 3
I just switched from QGIS 2.18 to version 3.0.3. In the earlier version, setting layer transparency was easily done with the "transparency" slider from the Layer properties->style tab. ...
25
votes
3
answers
22k
views
Making QGIS layer update from changed data source
I'm trying to get layers to update automatically when their data source changes. I'm using R to write a shapefile with an attribute, and colouring according to that attribute in QGIS.
I want to write ...
23
votes
4
answers
70k
views
Cutting/Clipping/Splitting polygon with another polygon from the same layer in QGIS
To not have overlapping polygons/features, I normally use one or more polygons to clip/shape other polygons. This is often much faster than tracing when adding polygons etc.
I cannot find this ...
22
votes
2
answers
41k
views
Adding shapefile or feature class as layer in ArcMap using ArcPy
I am trying to automate various tasks in ArcGIS Desktop (using ArcMap generally) with Python, and I keep needing a way to add a shapefile to the current map. (And then do stuff to it, but that's ...
22
votes
5
answers
28k
views
Using layer loadstart & loadend events in OpenLayers 3?
OpenLayers 2 has these layer events "loadstart & loadend."
What is equivalent to them in OpenLayers 3?
While a vector layer loads and is rendered, I need to show a loading icon.
21
votes
7
answers
18k
views
How to improve rendering performance of a very large shapefile?
I have a polygon shapefile that has a 100MB .dbf, and 500MB .shp file component. The reason it is so large, is that it is classified as a landbase for a whole district.
Everytime I view the file in ...
20
votes
3
answers
11k
views
Getting layer extent using PyQGIS
I'm trying to write a processing script using grass r.neighbors algorithm for rasters. When you use the GUI for this algorithm, you can leave the GRASS layer extent field blanc to use the minimal ...
19
votes
3
answers
8k
views
Duplicating layer in memory using PyQGIS
I have a layer in QGIS, and I want to duplicate it through a plugin so I can use the copy of it as I want, without modifying the original.
Of course layer2 = layer1 will not work, because everything ...
19
votes
3
answers
29k
views
How to perform a true GIS clip of polygons layer using a polygon layer in R?
I would like to do a true GIS Clip in R of soils polygons using a series of single boundary polygons, but I cannot find an R function to properly do it. It should work just like the clip function in ...
18
votes
2
answers
791
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 ...
17
votes
3
answers
8k
views
Using ArcPy to get layer symbology?
Since ArcGIS 10 comes with the ArcPy package, I'm wondering it is possible to use ArcPy functions to get Symbology (i.e color, width...) of a layer?
17
votes
1
answer
5k
views
Making layer or group private/hidden/invisible in Layers Panel of QGIS
I have a number of layers in the Layers Panel inside a group but I don't want them shown (there's quite a lot so it looks untidy). These layers are also joined to several others.
Is it possible to ...
16
votes
2
answers
21k
views
Getting list of layer names using PyQGIS [duplicate]
I need a list containing the names of all the layers in a QGIS session. I did the task as
layersNames = []
for i in self.iface.mapCanvas().layers():
layersNames.append(str(i.name()))
but this has ...
16
votes
3
answers
8k
views
Getting field names of layer using PyQGIS
How does one get a list of attributes/field names of a layer by means of PyQGIS 3?
If my layer has field names seen in the attribute table or properties. How can I use PyQGIS to give me a string list ...
16
votes
7
answers
35k
views
Getting extent of layer in QGIS
Is there a way to get the extent (bbox) of a vector layer in QGIS?
I see that I can update the extent, but I am looking for the actual coordinates of the extent.
16
votes
4
answers
10k
views
Adding layer to GeoPackage using PyQGIS
How to add layers (vector or raster to an existing GeoPackage)?
While loading an existing layer of a GeoPackage is quite trivial:
from qgis.utils import iface
path = '/home/matteo/geopackage.gpkg|...
16
votes
4
answers
2k
views
Compare similar lines and update layers
Here there are two layers with the representation of the streets and the idea is: We want to update the most recent layer (with the red line) with some of the data storaged in the other one (the light ...
15
votes
5
answers
27k
views
Removing feature layer using ArcPy script
I have an ArcPy based script where I'm trying to intersect two layers where one layer must have its centroid in the other layer.
Since I need to know that one layer (feature_layer below) includes the ...
15
votes
2
answers
44k
views
Leaflet: How to move the layer-control menu?
This might be a silly question, but I could not find a documented way to achieve this.
I'd like to freely position the layer-control menu, probably to the top left near the default zoom-in/out button....
15
votes
5
answers
37k
views
Changing layer order in Leaflet
I would like to be able to change the order of the layers in Leaflet.
I tried implementing two Leaflet plugins in order to change the layer order.
First I tried leaflet-control-orderlayers, which ...
15
votes
1
answer
4k
views
Repairing data sources in multiple MXDs using ArcPy?
I have about 50 mxd's with all broken layers that I have been going through and manually resetting.
The data was moved from another computer and the folder structure was changed so it isn't just a ...
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 ...
14
votes
9
answers
59k
views
How to export/save a layer composition to GeoTiff?
I want to export/save a QGIS composition of raster/vector layers to a GEOTIFF or ECW raster with high resolution (20 000 * 20 000 Pixel).
14
votes
1
answer
4k
views
Changing display name of layer with PyQGIS?
I did a batch processing of several vector layers and now the display name for every file is "dissolved" when accessing the layer.name() function in QGIS. I read in this answer from underdark to ...
14
votes
3
answers
2k
views
How to view layers by data source in QGIS 3?
Is there a tool or panel in QGIS 3 that allows a user to view the map layers by data source? Similar to the List By Source view in the ArcMap Table of Contents?
I thought I had come across it, but ...
14
votes
1
answer
788
views
Remove reference to raster layer object PyQGIS
I am developing a plugin to load a set of raster files on QGIS. When there is a large number of files to be loaded, the main UI freezes. So I use QgsTask to move the creation of raster layers to a ...
13
votes
1
answer
17k
views
How to add feature class to MXD with ArcPy (Python)? [duplicate]
I am using ArcGIS 10.1 and I am trying to add a feature class that I create to an MXD, so that I can join to it.
This all needs to be done using Python.
Is this possible?
13
votes
5
answers
21k
views
Z-index in OpenLayers 3: layer ordering in OL3
Is there a method to change Z-indexes of layers in OpenLayers3 like it was in old version?
map.setLayerIndex(markers, 99); //set the marker layer to an arbitrarily high layer index
I need to change ...
13
votes
2
answers
5k
views
Symbols above labels in map QGIS
I didn't find any answer to this question. In this post it is said that labels are by default on top of everything else: How to place labels under a vector layer?. But it was for 2.2, and years went ...
13
votes
1
answer
5k
views
Change vector layer symbology PyQGIS 3?
I'd like to change the symbology of my vector layer and can't figure it out how to read the documentation. I would like to have an polygone with an orange outline, a dashed fill style and an orange ...
13
votes
1
answer
12k
views
Use python to add layers to TOC
I've been battling with adding layers to the TOC for some time now. I have managed to single layers added but need to loop through a folder and add all layers. Shapefiles I cannot get to add at all. ...
13
votes
3
answers
3k
views
How to ignore "handle bad layers" in QGIS?
I have a QGIS (2.14.3-Essen) project that I use both at work and at home. I keep all but two layers with the project.
The two remaining layers are very large - a DEM and hillshade totaling more than ...
13
votes
1
answer
6k
views
Sort layers in QGIS table of contents?
When I load a bunch of layers into QGIS from PostGIS, they seem to load in reverse alphabetical order.
Is there any tools or plugins that allow you to quickly sort the QGIS TOC in a different order? ...
12
votes
2
answers
10k
views
What are the min and max values of Map.addLayer on Google Earth Engine? [closed]
I'm starting to play with Google Earth Engine. Following https://developers.google.com/earth-engine/image_visualization I see its possible to set min/max values.
May I ask the meaning of this and ...
12
votes
3
answers
3k
views
Create Layer from Selected Features tool: How is the list of features stored?
In ArcGIS Desktop, there is a tool called Create Layer from Selected Features. Using this tool, I can convert a selection to a layer in ArcMap.
It's my guess that there is a "list of features&...
12
votes
4
answers
2k
views
How many layers are too many layers in ArcMap?
I work on ArcGIS using a Citrix virtual software connection at work. It is dreadfully slow at times, and without any changes to the MXDs I'm working on, one minute ArcMap can be operating at a ...
12
votes
3
answers
23k
views
Setting Definition Query on ArcPy layer from shapefile for ArcMap
I am trying to determine options to set a layer definition query using ArcPy.
I know that it is possible when using arcpy.mapping.ListLayers().
However, in this scenario I am loading in ...
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('...