Estoy tratando de determinar si mi shapefile que paso está en M-aware (tiene valor M). Sigo recibiendo un error
Attribute Error: 'Polyline' object has no attribute 'hasM'
No sé qué estoy haciendo mal.
import arcpy
def ValidInputGeometry(feat):
is_valid_poly_line = False
is_m_enabled = False
error_msg = None
if feat.type == "polyline":
if is_m_enabled == feat.hasM:
is_valid_poly_line = True
else:
error_msg = "The input geometry is not M-Aware"
else:
error_message = "The input geometry is not a polyline"
return (is_valid_poly_line, error_msg)
station_interval = 10000
in_polyline_m_layer = "C:/Users/Algorithm/LWOB_levee.shp"
target_feature_rows = arcpy.SearchCursor(in_polyline_m_layer, "FID = 0", "", "", "")
layer_description = arcpy.Describe(in_polyline_m_layer)
shape_field = layer_description.ShapeFieldName
for row in target_feature_rows:
feat = row.getValue(shape_field)
(Valid, Msg) = ValidInputGeometry(feat)