AddFeatures returned values ...?

المشرف العام

Administrator
طاقم الإدارة
i try to add Features in a polygon vector layer. i'm using for example the following lines :

fet.setGeometry(ft_com.geometry()) bool=pro.addFeatures([fet]) bool returns me True (i see the added object appear in layer) and should return a list of added Features (?).

if i print bool i get something like :

(True, []) but what is this QgsFeature object pointer ? printing fet or bool[1][0] gives me two apparently different (?) pointers

Are they two different pointers pointing to the same object (it seems to be the case after checking "area" property ...) ?

i have another question : does this addFeatures allow mixing geometries (i know it is a banned practise) ? When i try :

fet.setGeometry(ft_com.geometry().centroid()) bool=pro.addFeatures([fet]) Bool returns TRUE, i see a new line appear in the attribute table of the modified layer but i don't see in that case the (point ?) object appear in the MapCanvas ...

Is it an expected behaviour ?

Thanks for your help !



أكثر...
 
أعلى