laptop and a wrench

不具合

When geometry objects in ArcPy are updated using a cursor, the m-value defaults to 0 instead of null while setting the m-value to null with a cursor causes the edit to be ignored and the value to revert to the original.

最後に公開された状態: December 15, 2022 ArcGIS Pro
不具合 ID 番号 BUG-000151375
送信されましたAugust 5, 2022
最終更新日July 4, 2026
適用対象ArcGIS Pro
見つかったバージョン2.9
オペレーティング システムWindows OS
オペレーティング システムのバージョンN/A
ステータスUnder Consideration

対処法

Use pt.M = "nan" instead of None and ensure the geometry is M-enabled when recreating it.

def dropMValues(fc):
    spatial_reference = arcpy.Describe(fc).spatialReference

    with arcpy.da.UpdateCursor(fc, "SHAPE@") as rows:
        for row in rows:
            geom = row[0]
            parts = arcpy.Array()
            for part in geom:
                points = arcpy.Array()
                for point in part:
                    point.M = "nan" # math.nan and float("nan") will also work
                    points.append(point)
                parts.append(points)
            row[0] = arcpy.Polyline(parts, spatial_reference, has_m=True)
            rows.updateRow(row)

再現の手順

不具合 ID: BUG-000151375

ソフトウェア:

  • ArcGIS Pro

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

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

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

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

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

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

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