laptop and a wrench

不具合

When running the lengths() function from the ArcGIS API for Python on a Polyline object, the function fails and returns the error message, “The operation was attempted on an empty geometry".

ArcGIS API for Python
不具合 ID 番号 BUG-000178221
送信されましたJuly 25, 2025
最終更新日September 4, 2025
適用対象ArcGIS API for Python
見つかったバージョン2.4.1
オペレーティング システムN/A
オペレーティング システムのバージョンN/A
修正されたバージョン2.4.2
ステータスFixed

対処法

Use the LengthUnits class to do this:

from arcgis.geometry import Polyline

from arcgis.geometry import lengths, LengthUnits

simple_polyline = Polyline({

  "paths": [[[-95.5, 30.2], [-95.6, 30.3]]],

  "spatialReference": {"wkid": 4326}

})

print(type(simple_polyline))

print(simple_polyline)

usFeet_simple = lengths(

  spatial_ref={"wkid": 4326},

  polylines=[simple_polyline],

  length_unit=LengthUnits.FOOT,

  calculation_type='geodesic',

  gis=gis

)

print("Length in US feet (simple):", usFeet_simple)

再現の手順

不具合 ID: BUG-000178221

ソフトウェア:

  • ArcGIS API for Python

バグのステータスが変更されたときに通知を受け取る

Esri Support アプリのダウンロード

このトピックについてさらに調べる

ArcGIS エキスパートのサポートを受ける

テクニカル サポートへのお問い合わせ

Esri Support アプリのダウンロード

ダウンロード オプションに移動