I want to get the length in meters of features with line-type geometry independent of the CRS of the layer and project.
Is there any way to do this?
I used the code below but I'm not sure of the unit of measurement.
p = QgsProject.instance()
layer = p.mapLayersByName('rede')[0]
d = QgsDistanceArea()
d.setEllipsoid('WGS84')
for feat in layer.getFeatures():
print(d.convertAreaMeasurement(d.measureLength(feat.geometry()), 1)*1000)