laptop and a wrench

Erro

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.

Última Publicação: December 15, 2022 ArcGIS Pro
Número de ID do Erro BUG-000151375
EnviadoAugust 5, 2022
Última ModificaçãoJuly 4, 2026
Aplica-se àArcGIS Pro
Versão encontrada2.9
Sistema OperacionalWindows OS
Versão do Sistema OperacionalN/A
StatusUnder Consideration

Solução Provisória

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)

Etapas para Reproduzir

ID do Erro: BUG-000151375

Software:

  • ArcGIS Pro

Seja notificado quando o status de um erro mudar

Baixe o Aplicativo de Suporte da Esri

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download