Save x,y,z values to a GeoJSON file from QGIS
To create a PolygonZ
use the following structure:
QgsGeometry( QgsPolygon( QgsLineString( lat_lon_points ) ) )
Example:
points = [QgsPoint(1,1,1), QgsPoint(1,2,2), QgsPoint(2,2,3)]
geometry = QgsGeometry( QgsPolygon( QgsLineString( points ) ) )
print(geometry)
# <QgsGeometry: PolygonZ ((1 1 1, 1 2 2, 2 2 3, 1 1 1))>) )
fet.setGeometry(geometry)