Skip to main content
GeorgeC's user avatar
GeorgeC's user avatar
GeorgeC's user avatar
GeorgeC
  • Member for 13 years, 7 months
  • Last seen this week
awarded
comment
TypeError when adding QgsGeometry object to canvas using PyQGIS
I worked it out...so you have to include most of the answer 2. buffer = end_point.buffer(20, 4) #Xm buffer with 4 segments buffer_lyr=QgsVectorLayer("Polygon?crs=epsg:28355","buffer", "memory") f = QgsFeature() f.setGeometry(buffer) buffer_lyr.dataProvider().addFeatures([f]) QgsProject.instance().addMapLayer(buffer_lyr) Seems excessive but works. I thought it would be simpler as the geometry object already exists.
comment
TypeError when adding QgsGeometry object to canvas using PyQGIS
I tried buffer_lyr=QgsVectorLayer("Polygon?crs=epsg:28355","buffer", "memory") QgsProject.instance().addMapLayer(buffer_lyr) and it added but no data in the table/no object visible even though the points to build the buffer are there as per the example in my question.
comment
TypeError when adding QgsGeometry object to canvas using PyQGIS
It already is a vector layer right? so isn't it the same as buff_layer in that link?
Loading…
awarded
awarded
accepted
comment
Error Qt QTemporaryDir when starting QGIS 3.25
Also happens in the Dev version -QGIS version 3.27.0-Master QGIS code revision b0d60567e5 Qt version 5.15.3 and you see Qt: Retrying to obtain clipboard. but everything seems to work fine.
awarded
Loading…
awarded
revised
Loading…
comment
QGIS format for 'Execute SQL query' in modeler
Sorry just added it to the example not in actual code. Updated example.
comment
QGIS format for 'Execute SQL query' in modeler
@user30184 I tried with Select as well but didn't work. The data is not in postgres just a flat file so the syntax would need to be SQL lite.
revised
QGIS format for 'Execute SQL query' in modeler
added example and changed code to use Update rather than Select
Loading…
revised
Loading…
1
3 4
5
6 7
88