yotacosmos

Field Calculator does not work

Discussion created by yotacosmos on Mar 18, 2011
Latest reply on Mar 23, 2011 by yotacosmos
Hi,

I recently upgraded from Arcgis 9.3 to ArcGIS 10 and now my geoprocessing script that converts from DMS to DD does not work after many changes in the syntax I am now stuck when it tries to calculate Long DD and Lat DD from DMS. I have created two new fields: LongDD, LatDD. The error I get is generic and cannot calculate LongDD and LatDD. I would appreciate any help. Here is part of the python script:

# Process: Add Field
arcpy.AddField_management(dbo_CopyRows, "LongDD", "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")

# Process: Add Field (2)
arcpy.AddField_management(dbo_CopyRows, "LatDD", "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")

# Process: Calculate Field
arcpy.CalculateField_management(dbo_CopyRows__4_, "Longitude", "Abs ( [Longitude] )", "VB", "")

# Process: Calculate Field (2)
arcpy.CalculateField_management(dbo_CopyRows__6_, "LongDD", "((Round( [Longitude] /10000 - 0.49999) + ((Round( [Longitude]/100 - 0.49999)Mod100)/60) + ( [Longitude] Mod 100)/3600))*(-1)", "VB", "")

# Process: Calculate Field (3)
arcpy.CalculateField_management(dbo_CopyRows__9_, "LatDD", "((Round( [Latitude] /10000 - 0.49999) + (Round( [Latitude]/100 - 0.49999)Mod100)/60) + ( [Latitude] Mod 100)/3600))", "VB", "")

Outcomes