Re: [Qgis-user] Extracting colours from a vector file
Hi Grant, Not sure if this is what you mean but if you want to get the colour of a feature's symbol you can use @symbol_color in the expression builder. So adding a "colour" column to your attributes and using field calculator to set the expression to @symbol_color will give you the colour for each feature. It will give you a hex colour code. If you need the RGB values, you can use the expression: colour_part(@symbol_color, 'red'), colour_part(@symbol_color, 'green'), colour_part(@symbol_color, 'blue') Regards, Alexei On Tue, 9 Apr 2024, at 08:54, Grant Boxer via QGIS-User wrote: > I would like to extract colours from a rule-based rendered shp file with the > aim of applying these colours to a MapInfo tab file. I have tried the rgb > function but that doesn’t seem to work. Anyone have any suggestions to > extract the red, green and blue values? > Cheers Grant, Perth WA > > ___ > QGIS-User mailing list > QGIS-User@lists.osgeo.org > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user > ___ QGIS-User mailing list QGIS-User@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
[Qgis-user] geojson
I have a streets layer in geojson. Is it possible to put the name tag on the line? Not in a popup. Thanks a lot ___ QGIS-User mailing list QGIS-User@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] WFS: Change symbolization (outline color/thickness and fill) using Python in QGIS.
Hi mikeE here is a small example based on your code: uri = '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' lyr14 = QgsVectorLayer(uri, "LSA: ALKIS Gebäude (WFS)" , 'WFS') # Farbe ändern lyr14.renderer().symbol().setColor(QColor("red")) lyr14.renderer().symbol().symbolLayer(0).setStrokeColor(QColor("blue")) lyr14.renderer().symbol().symbolLayer(0).setStrokeWidth(0.5) #lyr14.triggerRepaint() #braucht es nur wenn schon geladen # Legende updaten iface.layerTreeView().refreshLayerSymbology(lyr14.id()) QgsProject.instance().addMapLayer(lyr14) Am 09.04.2024 um 15:28 schrieb Elstermann, Mike via QGIS-User: 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 = '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' lyr14 = QgsVectorLayer(uri, "LSA: ALKIS Gebäude (WFS)" , ‚WFS') QgsProject.instance().addMapLayer(lyr14) Thanks & best regards, mikeE. ___ QGIS-User mailing list QGIS-User@lists.osgeo.org List info:https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe:https://lists.osgeo.org/mailman/listinfo/qgis-user -- Mit freundlichen Grüßen Stefan Giese Projektleiter/Consultant * Aufwind durch Wissen! Web-Seminare und Online-Schulungen bei derwww.foss-academy.com * WhereGroup GmbH Schwimmbadstr. 2 79100 Freiburg Germany Tel.: +49 (0)761 / 519 102 - 61 Fax: +49 (0)761 / 519 102 - 11 stefan.gi...@wheregroup.com www.wheregroup.com Geschäftsführer: Olaf Knopp, Peter Stamm Amtsgericht Bonn, HRB 9885 ___ QGIS-User mailing list QGIS-User@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
[Qgis-user] WFS: Change symbolization (outline color/thickness and fill) using Python in QGIS.
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 = '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' lyr14 = QgsVectorLayer(uri, "LSA: ALKIS Gebäude (WFS)" , ‚WFS') QgsProject.instance().addMapLayer(lyr14) Thanks & best regards, mikeE. ___ QGIS-User mailing list QGIS-User@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
[Qgis-user] Extracting colours from a vector file
I would like to extract colours from a rule-based rendered shp file with the aim of applying these colours to a MapInfo tab file. I have tried the rgb function but that doesn't seem to work. Anyone have any suggestions to extract the red, green and blue values? Cheers Grant, Perth WA ___ QGIS-User mailing list QGIS-User@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user