Skip to main content
added 10 characters in body
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148

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
        )
    )

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
        )
    )

One way could be:

d = QgsDistanceArea()
d.setEllipsoid('WGS84')
layer = iface.activeLayer() 
features = layer.getFeatures()

for feat in features:
    print(
        d.convertAreaMeasurement(
            d.measureLength(feat.geometry()),
            1
        )
    )
Source Link
cabesuon
  • 1.1k
  • 6
  • 8

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
        )
    )