Move SHP to gdb and ArcView license (newbie frustration)!!!

3141
54
04-11-2012 07:58 AM
LucaMoiana
New Contributor
Hi there,
What I need to do is move all the files into an mxd to a newly created gdb, chechking prj, and update mxd reference.

I have ArcGIS 10 SP4, license ArcView

I studied a bit of Python and get familiar with basic, then I copied some written code and pasted all together, attached is the code.

My frustration is that i can???t even move my shp files to a created gdb, is that because of my ArcView license?

PLEASE PLEASE PLEASE HELP

# Import system modules
import arcpy
from arcpy import env
import os
 
# Set environment settings
env.workspace = "C:/Users/a391665/Documents/AAAAPERSONALE/rugareto"

# Execute CreateFileGDB
arcpy.CreateFileGDB_management("C:/park", "test4")
 
# Set local variables
outWorkspace = "c:/park/test4.gdb"


# Use ListFeatureClasses to generate a list of shapefiles in the
#  workspace shown above.
fcList = arcpy.ListFeatureClasses()
 
# Execute CopyFeatures for each input shapefile
for shapefile in fcList:
    # Determine the new output feature class path and name
    outFeatureClass = os.path.join(outWorkspace, shapefile.strip(".shp"))
    arcpy.CopyFeatures_management(shapefile, outFeatureClass)
Tags (2)
0 Kudos
54 Replies
MathewCoyle
Frequent Contributor
What is your input coordinate system? You probably have to define a transformation.
0 Kudos
LucaMoiana
New Contributor
What is your input coordinate system? You probably have to define a transformation.


As a test I'm suing an undefined and a GCS_Monte_Mario_Rome and GCS_WGS_1984; but ideally I would have 4 or 5 different prj as input and 2 different prj as output, these should be defined as paramters of the tool.
0 Kudos
MathewCoyle
Frequent Contributor
You cannot project an undefined coordinate system without defining the input coordinate system.
0 Kudos
LucaMoiana
New Contributor
You cannot project an undefined coordinate system without defining the input coordinate system.


At the moment all layers are defined, but for the undefined I have:

            elif dsc.spatialReference.name == "Unknown":
                print os.path.join(workspace, fc, "UNKNOWN")
                fc_unkn = fc+'_unkn'
    arcpy.FeatureClassToGeodatabase_conversion(fc_unkn, outWorkspace)
    print os.path.join(workspace, fc_unkn, "imported in GDB")
0 Kudos
MathewCoyle
Frequent Contributor
Try doing a sample of each projection you want in ArcMap and it will give you a list of valid transformations. Then after you run it you can use the copy as python snippet as base to put in to each if case of your code.
0 Kudos