<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calibrate m from attribute table in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/calibrate-m-from-attribute-table/m-p/562919#M31956</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Posted the below at forum post 34274.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do not think it is possible to remeasure routes via the field calculator using python or VBA.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, you could use a script similar to the following to recalculate m values for an existing route feature class. I would change the reference to the feature class and to/from fields and run it in IDLE or PythonWin. It simulates the functionality of the setandinterpolatemsbetween arcobjects command.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.overwriteOutput=1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;inFC = r'C:\GIS\IncidentData\November\982292_Setandinterpolatemsbetween\test.gdb\routes_w_MPs' #Update path to the feature class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;toField = "BEGMP1" #Update name of the To Measure Field&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fromField = "ENDMP1" #Update name of the From Measure Field&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;desc = arcpy.Describe(inFC)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;shapeField = desc.shapeFieldName&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;oidField = desc.OIDFieldName&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;oidQueryName = arcpy.AddFieldDelimiters(inFC, oidField)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;g = arcpy.Geometry()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#Create update cursor on input feature class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rows = arcpy.UpdateCursor(inFC)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#Make feature layer from input feature class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.MakeFeatureLayer_management(inFC, "featureLayer")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#loop through rows in feature layer and select each OID&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for row in rows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.SelectLayerByAttribute_management("featureLayer", "New_Selection", oidQueryName + "=" + str(row.getValue(oidField)))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#create geometry object from each feature row&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;geomList = arcpy.CreateRoutes_lr("featureLayer", toField, g, "TWO_FIELDS", fromField, toField)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#update shape field for input feature class for each row (replace M values)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;row.setValue(shapeField, geomList[0])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rows.updateRow(row)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Delete_management("featureLayer")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del row, rows&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks to Chris F. in Redlands for creating this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Nov 2011 12:21:29 GMT</pubDate>
    <dc:creator>JacobPetrosky</dc:creator>
    <dc:date>2011-11-09T12:21:29Z</dc:date>
    <item>
      <title>Calibrate m from attribute table</title>
      <link>https://community.esri.com/t5/data-management-questions/calibrate-m-from-attribute-table/m-p/562918#M31955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I can�??t figure out how to do something in Arc 10 I use to be able to do in Arc 8X �?? 9X. What I need to do is Calibrate (Re-Calibrate) the M values on a selected set of routes based on two attribute values in the Route Feature classes attribute table. The attribute columns I�??m using are numeric fields and are named �??BMP" (Beginning Mile Post) and "EMP" (Ending Mile Post). I us to be able to do this with a VBA field calculator script. Here is the old VBA script I use to use.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;dim pms as imsegmentation&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;set pms = [Shape]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pms.setandinterpolatemsbetween [BMP], [EMP]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dim pg as igeometry&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;set pg = pms&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pg&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone tell me if there is a way to basically do the same thing in ArcGIS 10. It can be Python or other method. I need to be able to write the new M values back to the original routes, and not create a new feature class. If it matters our Route feature classes are in SDE.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rick Crawford USDA Forest Service&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 19:36:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/calibrate-m-from-attribute-table/m-p/562918#M31955</guid>
      <dc:creator>RickCrawford</dc:creator>
      <dc:date>2011-08-17T19:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calibrate m from attribute table</title>
      <link>https://community.esri.com/t5/data-management-questions/calibrate-m-from-attribute-table/m-p/562919#M31956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Posted the below at forum post 34274.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do not think it is possible to remeasure routes via the field calculator using python or VBA.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, you could use a script similar to the following to recalculate m values for an existing route feature class. I would change the reference to the feature class and to/from fields and run it in IDLE or PythonWin. It simulates the functionality of the setandinterpolatemsbetween arcobjects command.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.overwriteOutput=1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;inFC = r'C:\GIS\IncidentData\November\982292_Setandinterpolatemsbetween\test.gdb\routes_w_MPs' #Update path to the feature class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;toField = "BEGMP1" #Update name of the To Measure Field&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fromField = "ENDMP1" #Update name of the From Measure Field&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;desc = arcpy.Describe(inFC)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;shapeField = desc.shapeFieldName&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;oidField = desc.OIDFieldName&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;oidQueryName = arcpy.AddFieldDelimiters(inFC, oidField)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;g = arcpy.Geometry()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#Create update cursor on input feature class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rows = arcpy.UpdateCursor(inFC)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#Make feature layer from input feature class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.MakeFeatureLayer_management(inFC, "featureLayer")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#loop through rows in feature layer and select each OID&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for row in rows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.SelectLayerByAttribute_management("featureLayer", "New_Selection", oidQueryName + "=" + str(row.getValue(oidField)))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#create geometry object from each feature row&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;geomList = arcpy.CreateRoutes_lr("featureLayer", toField, g, "TWO_FIELDS", fromField, toField)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#update shape field for input feature class for each row (replace M values)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;row.setValue(shapeField, geomList[0])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rows.updateRow(row)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Delete_management("featureLayer")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del row, rows&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks to Chris F. in Redlands for creating this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2011 12:21:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/calibrate-m-from-attribute-table/m-p/562919#M31956</guid>
      <dc:creator>JacobPetrosky</dc:creator>
      <dc:date>2011-11-09T12:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calibrate m from attribute table</title>
      <link>https://community.esri.com/t5/data-management-questions/calibrate-m-from-attribute-table/m-p/562920#M31957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Link to other thread is &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/34274-remeasure-routes-in-field-calculator-using-python"&gt;http://forums.arcgis.com/threads/34274-remeasure-routes-in-field-calculator-using-python&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2011 12:25:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/calibrate-m-from-attribute-table/m-p/562920#M31957</guid>
      <dc:creator>JacobPetrosky</dc:creator>
      <dc:date>2011-11-09T12:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calibrate m from attribute table</title>
      <link>https://community.esri.com/t5/data-management-questions/calibrate-m-from-attribute-table/m-p/562921#M31958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jacob:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you know if the method you used would preserve circular, elliptical and bezier polyline geometries?&amp;nbsp; I know that most attempts to use arcpy to deal with such geometries at the segment level result in loss of this type geometry information.&amp;nbsp; I need to query each point X,Y,Z and M values and part segment lengths in a polyline rather than just interpolate from the ends and need to preserve the non-linear geometries.&amp;nbsp; Can this be done in arcpy, or is that only possible in ArcObjects.&amp;nbsp; (The help suggests that arcpy cannot be used to access low level geometries, so I tend to think the answer is no).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2011 16:20:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/calibrate-m-from-attribute-table/m-p/562921#M31958</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2011-11-09T16:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calibrate m from attribute table</title>
      <link>https://community.esri.com/t5/data-management-questions/calibrate-m-from-attribute-table/m-p/562922#M31959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Richard, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do not know a way to work with the non-linear geometries in arcpy.&amp;nbsp; I would suspect, as you have, that it is not possible.&amp;nbsp; I would start a new forum thread and ask (if you haven't already).&amp;nbsp; If you don't get an answer you can always submit an idea at &lt;/SPAN&gt;&lt;A href="http://ideas.arcgis.com"&gt;http://ideas.arcgis.com&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2011 16:33:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/calibrate-m-from-attribute-table/m-p/562922#M31959</guid>
      <dc:creator>JacobPetrosky</dc:creator>
      <dc:date>2011-11-09T16:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Calibrate m from attribute table</title>
      <link>https://community.esri.com/t5/data-management-questions/calibrate-m-from-attribute-table/m-p/562923#M31960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Posted the below at forum post 34274.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;I do not think it is possible to remeasure routes via the field calculator using python or VBA.&lt;BR /&gt;&lt;BR /&gt;However, you could use a script similar to the following to recalculate m values for an existing route feature class. I would change the reference to the feature class and to/from fields and run it in IDLE or PythonWin. It simulates the functionality of the setandinterpolatemsbetween arcobjects command.&lt;BR /&gt;&lt;BR /&gt;import arcpy&lt;BR /&gt;arcpy.env.overwriteOutput=1&lt;BR /&gt;inFC = r'C:\GIS\IncidentData\November\982292_Setandinterpolatemsbetween\test.gdb\routes_w_MPs' #Update path to the feature class&lt;BR /&gt;toField = "BEGMP1" #Update name of the To Measure Field&lt;BR /&gt;fromField = "ENDMP1" #Update name of the From Measure Field&lt;BR /&gt;desc = arcpy.Describe(inFC)&lt;BR /&gt;shapeField = desc.shapeFieldName&lt;BR /&gt;oidField = desc.OIDFieldName&lt;BR /&gt;oidQueryName = arcpy.AddFieldDelimiters(inFC, oidField)&lt;BR /&gt;g = arcpy.Geometry()&lt;BR /&gt;#Create update cursor on input feature class&lt;BR /&gt;rows = arcpy.UpdateCursor(inFC)&lt;BR /&gt;#Make feature layer from input feature class&lt;BR /&gt;arcpy.MakeFeatureLayer_management(inFC, "featureLayer")&lt;BR /&gt;&lt;BR /&gt;#loop through rows in feature layer and select each OID&lt;BR /&gt;for row in rows:&lt;BR /&gt;arcpy.SelectLayerByAttribute_management("featureLayer", "New_Selection", oidQueryName + "=" + str(row.getValue(oidField)))&lt;BR /&gt;#create geometry object from each feature row&lt;BR /&gt;geomList = arcpy.CreateRoutes_lr("featureLayer", toField, g, "TWO_FIELDS", fromField, toField)&lt;BR /&gt;#update shape field for input feature class for each row (replace M values)&lt;BR /&gt;row.setValue(shapeField, geomList[0])&lt;BR /&gt;rows.updateRow(row)&lt;BR /&gt;&lt;BR /&gt;arcpy.Delete_management("featureLayer")&lt;BR /&gt;del row, rows&lt;BR /&gt;&lt;BR /&gt;Many thanks to Chris F. in Redlands for creating this.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Slight modifications to the script.&amp;nbsp; See below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.overwriteOutput=1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;inFC = r"C:\GIS\IncidentData\November\982292_Setandinterpolatemsbetween\UserData\PwkTransportationFDSCopyNovember2011.gdb\RouteCopySubsetNov2" #Update path to the feature class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;toField = "MILEMARKER_END" #Update name of the To Measure Field&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fromField = "MILEMARKER_BEGIN" #Update name of the From Measure Field&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;routeID = "ROUTEID" #Update name of Route ID field&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;desc = arcpy.Describe(inFC)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;shapeField = desc.shapeFieldName&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print shapeField&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;oidField = desc.OIDFieldName&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print oidField&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;oidQueryName = arcpy.AddFieldDelimiters(inFC, oidField)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;g = arcpy.Geometry()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#Create update cursor on input feature class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rows = arcpy.UpdateCursor(inFC)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#Make feature layer from input feature class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.MakeFeatureLayer_management(inFC, "featureLayer")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#loop through rows in feature layer and select each OID&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for row in rows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management("featureLayer", "New_Selection", oidQueryName + "=" + str(row.getValue(oidField)))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #create geometry object from each feature row&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; geomList = arcpy.CreateRoutes_lr("featureLayer", routeID, g, "TWO_FIELDS", fromField, toField)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #update shape field for input feature class for each row (replace M values)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue(shapeField, geomList[0])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.updateRow(row)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Delete_management("featureLayer")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del row, rows&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2011 20:14:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/calibrate-m-from-attribute-table/m-p/562923#M31960</guid>
      <dc:creator>JacobPetrosky</dc:creator>
      <dc:date>2011-11-14T20:14:48Z</dc:date>
    </item>
  </channel>
</rss>

