[GIS] Arcpy.da.SearchCursor to retrieve the min and max measure values from Polyline-M shape

arcpycursorlinear-referencing

Is there a way to use a search cursor in ArcGIS to read the minimum measure and maximum measure values of a linear referenced route layer using arcpy? My goal is to build a route event using the start and end points of line segments but cannot figure out how to retrieve this data other than using the Identify Route Location Tool in ArcMap. I would like to get that type of information but using python.

Best Answer

Something like this?

with arcpy.da.SearchCursor(fc, "SHAPE@") as rows:
    for row in rows:
        extent = row[0].extent
        # Just an example of accessing the measures from extent:
        arcpy.AddMessage("Feature measures from {0} to {1}.".format(extent.MMin, extent.MMax))
Related Question