francesco_81

Project Trasformation for a list of shp don't work

Discussion created by francesco_81 on Jan 9, 2014
Latest reply on Jan 9, 2014 by jskinner-esristaff
hello guys.
I wrote this script that should read a list of shp file from a folder and then define the spatial and then the project.
How do I create db before, and in one of these I'm going to put the result.
The model works but does not run the project.
Can you help? I do not understand why is not working
This is my script
import arcpy, os
from arcpy import env

# Envirement Settings
arcpy.env.workspace = arcpy.GetParameterAsText(0)

# Variabili per la funzione di CreateFileGDB
out_folder_gdb = arcpy.GetParameterAsText(1)
name_gdb = arcpy.GetParameterAsText(2)
out_folder_gdb_utm = arcpy.GetParameterAsText(3)
name_gdb_utm = arcpy.GetParameterAsText(4)

# Creazione dei DB
arcpy.CreateFileGDB_management(out_folder_gdb, name_gdb)
arcpy.CreateFileGDB_management(out_folder_gdb_utm, name_gdb_utm)


# Imposto lista elementi
fcs = arcpy.ListFeatureClasses('*')


imposto variabile locale
try:
    for f in fcs:
        inData = f
        coordinateSystems = "PROJCS['Monte_Mario_Rome_Italy_1',GEOGCS['GCS_Monte_Mario_Rome',DATUM['D_Monte_Mario',SPHEROID['International_1924',6378388.0,297.0]],PRIMEM['Rome',12.45233333333333],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',1500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-3.45233333],PARAMETER['Scale_Factor',0.9996],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]"
        arcpy.DefineProjection_management(inData, coordinateSystems)
        arcpy.Project_management(inData,out_folder_gdb + "/" + name_gdb + ".gdb", "WGS 1984 UTM Zone 32N","", "Monte_Mario_To_WGS_1984_4")
except arcpy.ExecuteError:
    print(arcpy.GetMessages(2))
    
except Exception as ex:
    print(ex.args[0])

thank you very much
greetings

Outcomes