Skip to main content
deleted 18 characters in body; edited title
Source Link
Kadir Şahbaz
  • 78k
  • 57
  • 257
  • 404

Apply transparency on a wfsWFS layer (pyqgisPyQGIS)

I'm trying to make a wfs layer transparent, but it gives me a mistake, but I can't solve it until now.

thisThis is my code:

uri ='http://gstore.unm.edu/apps/rgis/datasets/6ca5428a-a78c-4c82-8120-da70dc92f2cc/services/ogc/wfs?SERVICE=wfs&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=tl_2010_35_state10'

wfslayer = QgsVectorLayer(uri, "MEXICO", "WFS")

QgsProject.instance().addMapLayer(wfslayer)

uri ='http://gstore.unm.edu/apps/rgis/datasets/6ca5428a-a78c-4c82-8120-da70dc92f2cc/services/ogc/wfs?SERVICE=wfs&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=tl_2010_35_state10'

wfslayer = QgsVectorLayer(uri, "MEXICO", "WFS")

QgsProject.instance().addMapLayer(wfslayer)

So far everything is correct

renderer = wfslayer.rendererV2()

 renderer = wfslayer.rendererV2()

In this function it gives me the mistake I

I don't know if it's a problem with the version (QGisQGIS 3.16.2) of the program or with the code.

itIt no longer lets me put the rest of the code

symbol = renderer.symbol() symbol.setAlpha(0.5)

Thank you and best regards.

Oscar

symbol = renderer.symbol()
symbol.setAlpha(0.5)

Apply transparency on a wfs layer (pyqgis)

I'm trying to make a wfs layer transparent, but it gives me a mistake, but I can't solve it until now.

this is my code:

uri ='http://gstore.unm.edu/apps/rgis/datasets/6ca5428a-a78c-4c82-8120-da70dc92f2cc/services/ogc/wfs?SERVICE=wfs&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=tl_2010_35_state10'

wfslayer = QgsVectorLayer(uri, "MEXICO", "WFS")

QgsProject.instance().addMapLayer(wfslayer)

So far everything is correct

renderer = wfslayer.rendererV2()

In this function it gives me the mistake I don't know if it's a problem with the version (QGis 3.16.2) of the program or with the code

it no longer lets me put the rest of the code

symbol = renderer.symbol() symbol.setAlpha(0.5)

Thank you and best regards.

Oscar

Apply transparency on a WFS layer (PyQGIS)

I'm trying to make a wfs layer transparent, but it gives me a mistake, but I can't solve it until now.

This is my code:

uri ='http://gstore.unm.edu/apps/rgis/datasets/6ca5428a-a78c-4c82-8120-da70dc92f2cc/services/ogc/wfs?SERVICE=wfs&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=tl_2010_35_state10'

wfslayer = QgsVectorLayer(uri, "MEXICO", "WFS")

QgsProject.instance().addMapLayer(wfslayer)

So far everything is correct

 renderer = wfslayer.rendererV2()

In this function it gives me the mistake

I don't know if it's a problem with the version (QGIS 3.16.2) of the program or with the code.

It no longer lets me put the rest of the code.

symbol = renderer.symbol()
symbol.setAlpha(0.5)
Source Link
Oskar
  • 13
  • 3

Apply transparency on a wfs layer (pyqgis)

I'm trying to make a wfs layer transparent, but it gives me a mistake, but I can't solve it until now.

this is my code:

uri ='http://gstore.unm.edu/apps/rgis/datasets/6ca5428a-a78c-4c82-8120-da70dc92f2cc/services/ogc/wfs?SERVICE=wfs&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=tl_2010_35_state10'

wfslayer = QgsVectorLayer(uri, "MEXICO", "WFS")

QgsProject.instance().addMapLayer(wfslayer)

So far everything is correct

renderer = wfslayer.rendererV2()

In this function it gives me the mistake I don't know if it's a problem with the version (QGis 3.16.2) of the program or with the code

it no longer lets me put the rest of the code

symbol = renderer.symbol() symbol.setAlpha(0.5)

Thank you and best regards.

Oscar