rralbritton

Extract by Mask Not Saving to Correct Location

Discussion created by rralbritton on Oct 30, 2013
Latest reply on Oct 31, 2013 by rralbritton
My script has been working fine and it's suddenly stopped. Its getting hung up on the Extract by Mask task, and its failing because its trying to save the output to a location other then what I've specified. Why would this be happening? I've even restarted my computer and I'm still getting the same problem.

import arcpy

#set workspaces
arcpy.env.workspace = "C:\\ArcGIS\\SurfCityData\\Data" #arcpy.GetParameterAsText(0) 
outputWorkspace = "C:\\ArcGIS\\SurfCityData\\Data\\OutputData" #arcpy.GetParameterAsText(1) 
arcpy.env.overwriteOutput = True

#Variables
ObsPts = "C:\\ArcGIS\\SurfCityData\\Data\\Projected_Data\\Test_Points.shp" #arcpy.GetParameterAsText(2)
footprint =  "C:\\ArcGIS\\SurfCityData\\Data\\Projected_Data\\Building_Footprints.shp" #arcpy.GetParameterAsText(3) 
Elevation = "C:\\ArcGIS\\SurfCityData\\Data\\Projected_Data\\new_2010 "#arcpy.GetParameterAsText(4)
BareElevation = "C:\\ArcGIS\\SurfCityData\\Data\\Projected_Data\\baregrnd" #arcpy.GetParameterAsText(5)

FOLDER = outputWorkspace+"/Intermediate_Files_1_"+Year

PointsFL = outName(ObsPts,"_Lyr")
footprintFL = outName(footprint,"_Lyr")
arcpy.MakeFeatureLayer_management(ObsPts, LAYER)
arcpy.MakeFeatureLayer_management(footprint,footprintFL)

try:
            
            FID = "FID=%s" % (points)

            #Get bare earth elevation of parcel
            arcpy.SelectLayerByAttribute_management(LAYER,"NEW_SELECTION",FID)
            arcpy.SelectLayerByLocation_management(footprintFL,"INTERSECT",LAYER)
            outExtractByMask = ExtractByMask(BareElevation,footprintFL)
            outExtractByMask.save(FOLDER+"/tempfp_"+str(FID)[4:])

except:
            print arcpy.GetMessages()



ERROR MESSAGE:

ERROR 000875: Output raster: C:\ArcGIS\SurfCityData\Data\OutputData/Intermediate_Files_1_2010\Extract_bare1's workspace is an invalid output workspace.

Outcomes