Skip to main content
Tweeted twitter.com/StackGIS/status/1091260028688977920
edited body; edited title
Source Link
Jochen Schwarze
  • 14.9k
  • 8
  • 54
  • 120

Rename layers with PyQGIS script

Just discovered QgisQGIS and really impressed! I've not formal GIS training so rely on Google to figure stuff out.

I'm using the SHP files made available by the Canadian Government as part of their CANVEC+ set. The SHP files are made available by NTS map sheet.

The naming shows what of data is in the layer. I've a batch files that copies the layers I'm interested in out of a mapsheet dir.

I was trying to rename the Layer with a PyQgisPyQGIS script. Examples on the internet got me to the point of being able to list the layers. If statements to match what I need. But have been unable to find if I can assign a new name value that way?

Is there a better way to do this, because I'm guessing this a pretty common problem?

Can I use the same script logic to assign a transparency (or maybe even a style)?

Rename layers with script

Just discovered Qgis and really impressed! I've not formal GIS training so rely on Google to figure stuff out.

I'm using the SHP files made available by the Canadian Government as part of their CANVEC+ set. The SHP files are made available by NTS map sheet.

The naming shows what of data is in the layer. I've a batch files that copies the layers I'm interested in out of a mapsheet dir.

I was trying to rename the Layer with a PyQgis script. Examples on the internet got me to the point of being able to list the layers. If statements to match what I need. But have been unable to find if I can assign a new name value that way?

Is there a better way to do this, because I'm guessing this a pretty common problem?

Can I use the same script logic to assign a transparency (or maybe even a style)?

Rename layers with PyQGIS script

Just discovered QGIS and really impressed! I've not formal GIS training so rely on Google to figure stuff out.

I'm using the SHP files made available by the Canadian Government as part of their CANVEC+ set. The SHP files are made available by NTS map sheet.

The naming shows what of data is in the layer. I've a batch files that copies the layers I'm interested in out of a mapsheet dir.

I was trying to rename the Layer with a PyQGIS script. Examples on the internet got me to the point of being able to list the layers. If statements to match what I need. But have been unable to find if I can assign a new name value that way?

Is there a better way to do this, because I'm guessing this a pretty common problem?

Can I use the same script logic to assign a transparency (or maybe even a style)?

thanks removed
Source Link
SS_Rebelious
  • 5.6k
  • 3
  • 28
  • 62

Just discovered Qgis and really impressed! I've not formal GIS training so rely on Google to figure stuff out.

I'm using the SHP files made available by the Canadian Government as part of their CANVEC+ set. The SHP files are made available by NTS map sheet.

The naming shows what of data is in the layer. I've a batch files that copies the layers I'm interested in out of a mapsheet dir.

I was trying to rename the Layer with a PyQgis script. Examples on the internet got me to the point of being able to list the layers. If statements to match what I need. But have been unable to find if I can assign a new name value that way?

Is there a better way to do this, because I'm guessing this a pretty common problem?

Can I use the same script logic to assign a transparency (or maybe even a style)?

Thank you! Bas

Just discovered Qgis and really impressed! I've not formal GIS training so rely on Google to figure stuff out.

I'm using the SHP files made available by the Canadian Government as part of their CANVEC+ set. The SHP files are made available by NTS map sheet.

The naming shows what of data is in the layer. I've a batch files that copies the layers I'm interested in out of a mapsheet dir.

I was trying to rename the Layer with a PyQgis script. Examples on the internet got me to the point of being able to list the layers. If statements to match what I need. But have been unable to find if I can assign a new name value that way?

Is there a better way to do this, because I'm guessing this a pretty common problem?

Can I use the same script logic to assign a transparency (or maybe even a style)?

Thank you! Bas

Just discovered Qgis and really impressed! I've not formal GIS training so rely on Google to figure stuff out.

I'm using the SHP files made available by the Canadian Government as part of their CANVEC+ set. The SHP files are made available by NTS map sheet.

The naming shows what of data is in the layer. I've a batch files that copies the layers I'm interested in out of a mapsheet dir.

I was trying to rename the Layer with a PyQgis script. Examples on the internet got me to the point of being able to list the layers. If statements to match what I need. But have been unable to find if I can assign a new name value that way?

Is there a better way to do this, because I'm guessing this a pretty common problem?

Can I use the same script logic to assign a transparency (or maybe even a style)?

Source Link
Basrijn
  • 183
  • 1
  • 6

Rename layers with script

Just discovered Qgis and really impressed! I've not formal GIS training so rely on Google to figure stuff out.

I'm using the SHP files made available by the Canadian Government as part of their CANVEC+ set. The SHP files are made available by NTS map sheet.

The naming shows what of data is in the layer. I've a batch files that copies the layers I'm interested in out of a mapsheet dir.

I was trying to rename the Layer with a PyQgis script. Examples on the internet got me to the point of being able to list the layers. If statements to match what I need. But have been unable to find if I can assign a new name value that way?

Is there a better way to do this, because I'm guessing this a pretty common problem?

Can I use the same script logic to assign a transparency (or maybe even a style)?

Thank you! Bas