Extract Multivalues to Points, strange error in Python

289
0
11-19-2011 12:45 PM
DavidHon
New Contributor
Hello,

I have been working on a terrestrial invasive plant species predictive model in Python for Eau Claire County, WI. I have a bunch of rasters that are controls on the invasive species distributions and intensities, so I join the raster cell data to the invasive species points, and use that information to create a new predictive layer.

However, when I run the model, it displays a strange error, and tells me the input point feature class (the invasive species) don't exist:

"ERROR 000865: Input point features: 'E:\invasive project\analysis\analysis_3.gdb\cs' does not exist."

Any ideas? Here is the code.
*****************

import arcpy

from arcpy import env

from arcpy.sa import *

import sys, os

import arcgisscripting

gp = arcgisscripting.create(9.3)



invasives = arcpy.GetParameterAsText (0) #invasive species fcs;multivalue

dfc = arcpy.GetParameterAsText (1)

dff = arcpy.GetParameterAsText (2)

dfr = arcpy.GetParameterAsText (3)

DI =  arcpy.GetParameterAsText (4)

asp = arcpy.GetParameterAsText (5)

slp =  arcpy.GetParameterAsText (6)

rdn = arcpy.GetParameterAsText (7)

rlu =  arcpy.GetParameterAsText (8)

#inraster1-8 are the factors used for reclassing

out_ws = arcpy.GetParameterAsText (9) #output workspace

scratch_ws = arcpy.GetParameterAsText (10) #scratch workspace



stat_rasters = [dfc, dff, dfr, asp, slp, rdn]

rc_rasters = [dfc, dff, dfr, slp, rdn]



gp.addmessage("building raster statistics...")

for stat_raster in stat_rasters:

arcpy.BatchCalculateStatistics_management(stat_raster)

gp.addmessage("...raster statistics complete.")



gp.addmessage("slicing rasters to 50 equal classes...")

for rc_raster in rc_rasters:

sliced_rasters = arcpy.Slice_3d(rc_raster, rc_raster + "_slice", "50", "EQUAL_INTERVAL")

gp.addmessage("...slicing complete.")



all_rasters = [sliced_rasters, DI, rlu, asp]



invasives = invasives.split(";")

for invasive in invasives:

(filePath, fileName) = os.path.split(invasive)

dotInd = fileName.find(".") #finds the extension name e.g. .shp

if dotInd <> -1: #looks at what is before the extension name

  newFC = fileName[0:dotInd] #declares the filename that is before the extension filename

  out_inv = newFC + "_" #adds "_" to the new features' filename

else:

  out_inv = fileName + "_"



arcpy.CheckOutExtension("Spatial")

gp.addmessage("extracting raster values to invasive species points...this will take a while.")

extract_invasive = ExtractMultiValuesToPoints(invasive, all_rasters) #this is the line with the error

gp.addmessage("extraction complete!")

**************
I really appreciate the time anyone has to helping me troubleshoot this.

Thank you!

DH
0 Kudos
0 Replies