<div dir="ltr">Dear list,<div><br></div><div>It's not exactly clear how secondary geometry columns are to be used from QgsExpressions or Python code.</div><div><br></div><div>Just to be clear, by secondary geometry columns, I mean geometries stored in other columns that the one that is used to display the features on the map, typically a "center_point" field storing a Point on a Polygon layer.</div><div><br></div><div>When accessing them both in expression or Python, it seems it returns a string with the ewkt representation (at least for postgis layers). This is not really nice, as the only way to use it with functions such as make_line is to strip the SRID from the text to get proper wkt, then to make the create the feature using from_wkt. </div><div><br></div><div>This means instead of the nice and clear :</div><div>make_line( closest_point( $geometry, "center_point"), "center_point" )<br></div><div>You need :</div><div>make_line( closest_point( $geometry, geom_from_wkt( substr( "center_point", strpos("center_point", ';') + 1) )), geom_from_wkt( substr( "center_point", strpos("center_point", ';') + 1) ) )<br></div><div><br></div><div>It's also probably quite inefficient, which is an issue when used for geometry generators.</div><div><br></div><div>Is there a limitation preventing to return QgsGeometries directly ? If not, would it make sense to change QGIS to do so ? Does anyone have an efficient workaround in the mean time ?</div><div><br></div><div>Thanks :-)</div><div><br></div><div>Olivier</div></div>