<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi mikeE</p>
<p>here is a small example based on your code:</p>
<p><font face="Courier New, Courier, monospace">uri =
'<a class="moz-txt-link-freetext" href="https://www.geodatenportal.sachsen-anhalt.de/wss/service/ST_LVermGeo_ALKIS_WFS_OpenData/guest?&service=WFS&BBOX=1332412,6708967,1333423,6709355&restrictToRequestBBOX=1&VERSION=auto&typename=ave:GebaeudeBauwerk&srsname=EPSG:25832&preferCoordinatesForWfsT11=false&pagingEnabled=true">https://www.geodatenportal.sachsen-anhalt.de/wss/service/ST_LVermGeo_ALKIS_WFS_OpenData/guest?&service=WFS&BBOX=1332412,6708967,1333423,6709355&restrictToRequestBBOX=1&VERSION=auto&typename=ave:GebaeudeBauwerk&srsname=EPSG:25832&preferCoordinatesForWfsT11=false&pagingEnabled=true</a>'<br>
lyr14 = QgsVectorLayer(uri, "LSA: ALKIS Gebäude (WFS)" , 'WFS')<br>
# Farbe ändern<br>
lyr14.renderer().symbol().setColor(QColor("red"))<br>
lyr14.renderer().symbol().symbolLayer(0).setStrokeColor(QColor("blue"))<br>
lyr14.renderer().symbol().symbolLayer(0).setStrokeWidth(0.5) <br>
#lyr14.triggerRepaint() #braucht es nur wenn schon geladen<br>
# Legende updaten<br>
iface.layerTreeView().refreshLayerSymbology(lyr14.id())<br>
QgsProject.instance().addMapLayer(lyr14)</font><br>
</p>
<div class="moz-cite-prefix">Am 09.04.2024 um 15:28 schrieb
Elstermann, Mike via QGIS-User:<br>
</div>
<blockquote type="cite"
cite="mid:2CA028CE-0D25-4F6E-BD8F-30E25409E4A8@itc-halle.de">
<pre class="moz-quote-pre" wrap="">Hello everyone,
I have a code snippet to load a WFS, how can I easily change the symbolization (outline color/thickness and fill) using Python in QGIS?.
def addWFS14(self):
uri = '<a class="moz-txt-link-freetext" href="https://www.geodatenportal.sachsen-anhalt.de/wss/service/ST_LVermGeo_ALKIS_WFS_OpenData/guest?&service=WFS&BBOX=1332412,6708967,1333423,6709355&restrictToRequestBBOX=1&VERSION=auto&typename=ave:GebaeudeBauwerk&srsname=EPSG:25832&preferCoordinatesForWfsT11=false&pagingEnabled=true">https://www.geodatenportal.sachsen-anhalt.de/wss/service/ST_LVermGeo_ALKIS_WFS_OpenData/guest?&service=WFS&BBOX=1332412,6708967,1333423,6709355&restrictToRequestBBOX=1&VERSION=auto&typename=ave:GebaeudeBauwerk&srsname=EPSG:25832&preferCoordinatesForWfsT11=false&pagingEnabled=true</a>'
lyr14 = QgsVectorLayer(uri, "LSA: ALKIS Gebäude (WFS)" , ‚WFS')
QgsProject.instance().addMapLayer(lyr14)
Thanks & best regards, mikeE.
_______________________________________________
QGIS-User mailing list
<a class="moz-txt-link-abbreviated" href="mailto:QGIS-User@lists.osgeo.org">QGIS-User@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Mit freundlichen Grüßen
Stefan Giese
Projektleiter/Consultant
*********************************************
Aufwind durch Wissen!
Web-Seminare und Online-Schulungen
bei der <a class="moz-txt-link-abbreviated" href="http://www.foss-academy.com">www.foss-academy.com</a>
*********************************************
WhereGroup GmbH
Schwimmbadstr. 2
79100 Freiburg
Germany
Tel.: +49 (0)761 / 519 102 - 61
Fax: +49 (0)761 / 519 102 - 11
<a class="moz-txt-link-abbreviated" href="mailto:stefan.giese@wheregroup.com">stefan.giese@wheregroup.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.wheregroup.com">www.wheregroup.com</a>
Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885</pre>
</body>
</html>