I have a model where I want to check the projection. If it is GCS_WGS_1984, I want it to go one path, and if it isn't, I want it to go another path.
I created a "Check Coordinates of Input" script to output two Boolean values of True or False. The script is:
import arcpy, os from arcpy import env env.overwriteOutput = True arcpy.CheckOutExtension("Spatial") Footprints = arcpy.GetParameterAsText(0) desc = arcpy.Describe(Footprints) type = desc.spatialReference try: if type.name == "GCS_WGS_1984": arcpy.SetParameterAsText(1, "True") arcpy.SetParameterAsText(2, "False") else: arcpy.SetParameterAsText(1, "False") arcpy.SetParameterAsText(2, "True") except Exception as e: AddPrintMessage(e, 2)
When the input isn't in GCS_WGS_1984, the model is able to run okay. I get the True.kmz file but in the messages I also get "The process did not execute because the precondition is false" and "All the inputs are not current". When the input file is in GCS_WGS_1984 however, I get and error message from the Project function of "invalid geographic transformation" and it stops there.
How do I get it so that if the coordinates are true, the goes along the upper path, and if it's false, to go along the lower path?
I was reading something on ArcGIS's online resource about a Run Model Parameter http://resources.arcgis.com/en/help/main/10.2/index.html#//002w0000007r000000 being checked and was wondering if that would make a different? Still though, I don't know how to access that.
And this is for later if it all works out: If I'm running this in a tool dialog box, the options for the true and false kmz will be required, even if only one is going to be created?