Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

error script with project_management tool

$
0
0
hello guys,
I'm using the script for project features that is in the help of arcgis desktop, but I get a generic error 999999
this is the script code
HTML Code:

import arcpy, os
from arcpy import env

# Enviroment Setting
env.workspace = "C:/Users/fdivito/Documents/Commesse/LOMBARDIA_INFORMATICA/PolidroDati/DATI_ANALISI/Feature.gdb"
env.overwriteOutput = True

# Imposta variabile locale su cui viene salvato il risultato dell'operazione
outWorkspace = "C:/Users/fdivito/Documents/Commesse/LOMBARDIA_INFORMATICA/PolidroDati/DATI_ANALISI/Feature_utm.gdb"

try:
    # Use ListFeatureClasses to generate a list of inputs
    for infc in arcpy.ListFeatureClasses():
   
        # Determine if the input has a defined coordinate system, can't project it if it does not
        dsc = arcpy.Describe(infc)
   
        if dsc.spatialReference.Name == "Unknown":
            print ('skipped this fc due to undefined coordinate system: ' + infc)
        else:
            # Determine the new output feature class path and name
            outfc = os.path.join(outWorkspace, infc)
           
            # Set output coordinate system
            outCS = arcpy.SpatialReference('WGS_1984_UTM_Zone_32N')
           
            # run project tool
            arcpy.Project_management(infc, outfc, outCS)
           
            # check messages
            print(arcpy.GetMessages())
           
except arcpy.ExecuteError:
    print(arcpy.GetMessages(2))
   
except Exception as ex:
    print(ex.args[0])

Any help please?
Bye
Thanks

Viewing all articles
Browse latest Browse all 2485

Latest Images

Trending Articles



Latest Images