I have a data set with many maritime routes that I would like to see the m values (time) for. ArcGIS's Identify Route Locations tool works exactly as I want it to, however, the m value displayed is in Unix time which is not easily read, if at all. I need to convert the Unix times to something readable. I found that using datetime.datetime.fromtimestamp().isoformat() works great but I don't want the user to have to convert the time by hand every time they click along the line. Is there a way to create a tool that works like Identify Route Locations but also converts the m values before displaying them? I can't figure out how to access them. I've looked around and the only solutions I've found were to break down the routs back into points and recalculate the m values, but I'd rather avoid that.
Not sure the tool you are talking about is easy thing to do. What stops you of changing shapes themself using basic field calculator expression? You can run in on geometry (Shape) field, e.g. Modifying vertices x,y values to remove all value from 3rd decimal in ArcMap?
In environment settings make M enabled. Run this expression on Shape field:
def plineM(shp): arr=arcpy.Array();pM=arcpy.Point() part=shp.getPart(0);n=len(part) for i in xrange(n): p=part.getObject(i) pM.X=p.X;pM.Y=p.Y;pM.Z=p.Z pM.M=7627.462-p.M #your transformation here arr.add(pM) return arcpy.Polyline(arr)
plineM( !Shape! )