result of arcpy.CalculateField_management with python is inconsistent but with VB, it is ok
Alice:
What database are you using for this feature class, SDE? File Geodatabase? Personal Geodatabase? (it does not appear it could be a shapefile based on the field names). If it is SDE, what underlying database is SDE using? What version of ArcMap do you have?
It is possible that rather than just transferring the value in the shape.area field the Python version is processing the actual shape geometry directly and perhaps altering it if the original geometry contains such things as true curves, rather than densified lines to form a curve. Python has issues with true curves.
If you are at version 10.0 or above, the VB Script calculation has no access to the actual geometry and can only process the value in the shape.area field as a numeric field, so the methodologies underlying the two languages could be different.
Richard,
It's SDE. I'm calculating the same polygon but results are different from using VB vs Python
Thanks,
Alice
VB: arcpy.CalculateField_management(temp, "ft", "[shape.area]", "VB", "")
Python: arcpy.CalculateField_management(temp, "ft", "!SHAPE.area!", "PYTHON_9.3", "")
arcpy.CalculateField_management(temp, "ft", "!SHAPE.area!", "PYTHON_9.3", "")
result:
arcpy.CalculateField_management(temp, "ft", "[shape.area]", "VB", "")
There is no way anyone can help you or replicate what you are reporting without the specific calculation code you are using. Please post your calculation. Otherwise, if you are just making a general statement about calculation behaviors using the two languages then your observation is not true for any of the calculations I do.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.