4

I have several dozen rasters loaded into QGIS in a layer group. I'm looking at one of the rasters on the map, but I'm not sure which one it is. Is there a way to click on the raster on the map and get its name and/or cause it to become selected in the list of layers?

In the screenshot below, is there an easy way to get QGIS to tell me which raster layer(s) in the NAIP group is/are currently visible on the map?

qgis_screenshot

8

You can use pickLayer plugin to select the layer from the canvas and highlight it in the table of content (TOC).

When you use the tool, click the raster image in the canvas and select Set current layer and it will highlight the layer in the TOC.

enter image description here

You need to download the plugin from the Plugin manager.

5

You may want to use tileindex from QGIS using the following processing. You can access it as shown in the screenshot.

enter image description here

A tileindex is a vector layer you generate from raster tiles extent (in QGIS from your layers, if use with GDAL from the mentioned files). So, you have all the benefits of vector layers.

You may also be interested to use the recipe from https://twitter.com/klaskarlsson/status/1159514845127028738 to generate tileindex and then load on the fly your raster tiles "on demand".

4

Another option is to use PyQGIS to print out the layer names in current map extent:

layerlist = [layer for layer in QgsProject.instance().mapLayers().values()] #List all layers added to the map

e = iface.mapCanvas().extent() #Find current map extent

for l in layerlist:
    if l.extent().intersects(e): #If layer extent intersects current map extent
        print(l.name())

enter image description here

2

QGIS 3.20

The icon"Identify Features" tool (Ctrl+Shift+I) & right click on the point you want to identify the raster.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.