One way could be,:
d = QgsDistanceArea()
d.setEllipsoid('WGS84')
layer = iface.activeLayer()
feature = layer.getFeatures()
for feat in feature:
print(
d.convertAreaMeasurement(
d.measureLength(feat.geometry()),
1
)
)
d = QgsDistanceArea()
d.setEllipsoid('WGS84')
layer = iface.activeLayer()
features = layer.getFeatures()
for feat in features:
print(
d.convertAreaMeasurement(
d.measureLength(feat.geometry()),
1
)
)