Select to view content in your preferred language

Calculate Grid convergence error

642
2
01-31-2011 04:45 AM
MichaelStjernholm
Regular Contributor
Hi

I'm doingh some solar angle calculations and want to include a correction for the difference in angle between the coordinate system I use and the true north.
The tool CalculateGridConvergenceAngle_carthography should be able to do this but I constantly get an error indicating that the field Type should be wrong! (ERROR 000308: Invalid field type)

I have python statements like:
(footprintFC is a layer !)

if len(arcpy.ListFields(FootprintFC, "GeoAngle")) == 0:
    arcpy.AddField_management(FootprintFC, "GeoAngle", "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")


and

arcpy.CalculateGridConvergenceAngle_cartography(FootprintFC,"GeoAngle","GEOGRAPHIC")

Can somebody help me identifying the problem ?

Michael
0 Kudos
2 Replies
DuncanHornby
MVP Notable Contributor
Michael,

If your dataset is a shapefile try setting this:

arcpy.AddField_management(FootprintFC, "GeoAngle", "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")


to

arcpy.AddField_management(FootprintFC, "GeoAngle", "DOUBLE", "", "", "", "", "", "", "")


Duncan
0 Kudos
MichaelStjernholm
Regular Contributor
Hi Duncan

Thanks for your proposal.
I may have found the problem to be that the feature class was joined to a table. Now that I remove the join before CalculateGridAngle I no longer get the error message, which anyhow seemed to be misleading 😞


regards
Michael
0 Kudos