Select to view content in your preferred language

script does not work

2948
23
12-30-2011 04:06 AM
GerniceMuhamed
Emerging Contributor
Hi can some please assist me in reprojecting shapefiles. I want to reproject it in Geographic Coordinate System WGS 1984 and then into the Projected Coordinate System ???World_Cylindrical_Equal_Area..My script does not work..keeps telling me that there is an invalid syntax..When it reaches the resFC i get that invalid syntax at the line

This is what i have

if sr.Name == "Unknown":
# skip
     continue
else:
# Determine the new output feature class path and name
    outFeatureClass = os.path.join(outWorkspace, infc.strip(".shp")
# Set output coordinate system
resFc = outFeatureClass + "," + ("<install directory>/Coordinate Systems/Projected Coordinate Systems/WGS 1984.prj/Cylindrical Equal Area (world).prj")
                arcpy.Project_management(infc, outFeatureClass, outCS)
                arcpy.AddMessage("The shapefiiles have been reprojected")
                print "Get Area Info...."
Tags (2)
0 Kudos
23 Replies
JakeSkinner
Esri Esteemed Contributor
No, it should end with:

"Get Area Info...."

In Windows Explorer, check to make sure you shapefile does not have an associated .prj file with it.  If it does, delete the .prj file and then try executing the script again.  Also, check the output geodatabase to see if the feature class was created.
0 Kudos
GerniceMuhamed
Emerging Contributor
JSkinn3 I would like you to have a look at a script for me pleeeeaaaaasssssseeeeeeeee...
0 Kudos
JakeSkinner
Esri Esteemed Contributor
Feel free to post your code, or upload your .py file and I can take a look.
0 Kudos
GerniceMuhamed
Emerging Contributor
I cannot upload my script because it is something I am working on for work...Can you let me know if there is another medium in which I can send the script. Thanks much for your time
0 Kudos