Skip to main content
Tweeted twitter.com/StackGIS/status/821146728384647168
added 2 characters in body; edited tags; edited title
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Programatically turning Turning on another layer when one is selected in TOC using PyQGIS?

I have a large number of raster model files of water depths with corresponding velocity vectors in point shapefiles. I want to be able to 'walk through' the results displaying the depths and velocity vectors on top of each other but without having to select both layers in the TOC.

Would it be possible to write python code that would turn on the corresponding vector layer when a raster was turned on in the TOC, based on matching its name? 

It would ideally need no user input except to run the code before the user started to visualise the results.

The two files (one raster and one shapefile) have essentially the same names identifying the model name and containing a numeric identifier which would be unique to just those two layers.

Programatically turning on another layer when one is selected in TOC

I have a large number of raster model files of water depths with corresponding velocity vectors in point shapefiles. I want to be able to 'walk through' the results displaying the depths and velocity vectors on top of each other but without having to select both layers in the TOC.

Would it be possible to write python code that would turn on the corresponding vector layer when a raster was turned on in the TOC, based on matching its name? It would ideally need no user input except to run the code before the user started to visualise the results.

The two files (one raster and one shapefile) have essentially the same names identifying the model name and containing a numeric identifier which would be unique to just those two layers.

Turning on another layer when one is selected in TOC using PyQGIS?

I have a large number of raster model files of water depths with corresponding velocity vectors in point shapefiles. I want to be able to 'walk through' the results displaying the depths and velocity vectors on top of each other but without having to select both layers in the TOC.

Would it be possible to write python code that would turn on the corresponding vector layer when a raster was turned on in the TOC, based on matching its name? 

It would ideally need no user input except to run the code before the user started to visualise the results.

The two files (one raster and one shapefile) have essentially the same names identifying the model name and containing a numeric identifier which would be unique to just those two layers.

Source Link
Ed Rollason
  • 4k
  • 2
  • 20
  • 35

Programatically turning on another layer when one is selected in TOC

I have a large number of raster model files of water depths with corresponding velocity vectors in point shapefiles. I want to be able to 'walk through' the results displaying the depths and velocity vectors on top of each other but without having to select both layers in the TOC.

Would it be possible to write python code that would turn on the corresponding vector layer when a raster was turned on in the TOC, based on matching its name? It would ideally need no user input except to run the code before the user started to visualise the results.

The two files (one raster and one shapefile) have essentially the same names identifying the model name and containing a numeric identifier which would be unique to just those two layers.