Select to view content in your preferred language

ExecuteError: ERROR 999999: Error executing function.

4879
4
05-15-2013 04:57 PM
LEEjongseok
Emerging Contributor
i got the this error message.
what's wrong to me?



Traceback (most recent call last):
  File "C:/Users/Administrator/Desktop/arcpy/convert", line 36, in <module>
    saveRaster = arcpy.PointToRaster_conversion( filename2, "RASTERVALU", outRaster2, "MOST_FREQUENT", "NONE", cellSize)
  File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 1772, in PointToRaster
    raise e
ExecuteError: ERROR 999999: Error executing function.
Failed to execute (PointToRaster).




# Import arcpy module
import arcpy, os
from arcpy import env
from arcpy.sa import *



# Set environment settings
arcpy.env.workspace = "C:/py2/extract"
arcpy.env.overwriteOutput = True

OutputFolder2 = "C:/py2/result"

# Loop through a list of files in the workspace
RasterFiles2 = arcpy.ListFeatureClasses()

print "POINT TO RASTER"
print RasterFiles2
print " "



# Set local variables
for filename2 in RasterFiles2:
    print "Processing: {0}".format(filename2)
    outRaster2 = os.path.join(OutputFolder2, filename2 + "_4x")
    valField = "RASTERVALU"
    assignmentType = "MOST_FREQUENT"
    priorityField = "NONE"
    cellSize = "0.035714286"

# Execute ExtractValuesToPoints
    saveRaster = arcpy.PointToRaster_conversion( filename2, valField, outRaster2, assignmentType, priorityField, cellSize)

print "done "
print arcpy.GetMessages()
Tags (2)
0 Kudos
4 Replies
ChrisPedrezuela
Frequent Contributor
why is your cellsize in quotes?

i got the this error message.
what's wrong to me?



Traceback (most recent call last):
  File "C:/Users/Administrator/Desktop/arcpy/convert", line 36, in <module>
    saveRaster = arcpy.PointToRaster_conversion( filename2, "RASTERVALU", outRaster2, "MOST_FREQUENT", "NONE", cellSize)
  File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 1772, in PointToRaster
    raise e
ExecuteError: ERROR 999999: Error executing function.
Failed to execute (PointToRaster).




# Import arcpy module
import arcpy, os
from arcpy import env
from arcpy.sa import *



# Set environment settings
arcpy.env.workspace = "C:/py2/extract"
arcpy.env.overwriteOutput = True

OutputFolder2 = "C:/py2/result"

# Loop through a list of files in the workspace
RasterFiles2 = arcpy.ListFeatureClasses()

print "POINT TO RASTER"
print RasterFiles2
print " "



# Set local variables
for filename2 in RasterFiles2:
    print "Processing: {0}".format(filename2)
    outRaster2 = os.path.join(OutputFolder2, filename2 + "_4x")
    valField = "RASTERVALU"
    assignmentType = "MOST_FREQUENT"
    priorityField = "NONE"
    cellSize = "0.035714286"

# Execute ExtractValuesToPoints
    saveRaster = arcpy.PointToRaster_conversion( filename2, valField, outRaster2, assignmentType, priorityField, cellSize)

print "done "
print arcpy.GetMessages()
0 Kudos
LEEjongseok
Emerging Contributor
why is your cellsize in quotes?


My projection is GCS, so my cell size is quotes.. ^^
0 Kudos
LEEjongseok
Emerging Contributor
it is my attribut table in the shape file.

[ATTACH=CONFIG]24355[/ATTACH]

and, new code is here.


###########Point to Raster
# Import arcpy module
import arcpy, os
from arcpy import env
from arcpy.sa import *



# Set environment settings
arcpy.env.workspace = "C:/py2/extract"
arcpy.env.overwriteOutput = True

OutputFolder2 = "C:/py2/result"

# Loop through a list of files in the workspace
RasterFiles2 = arcpy.ListFeatureClasses()

print "POINT TO RASTER"
print RasterFiles2
print " "



# Set local variables
for filename2 in RasterFiles2:
    print "Processing: {0}".format(filename2)
    outRaster2 = os.path.join(OutputFolder2, filename2)
    value = "RASTERVALU"
    assignmentType = "MOST_FREQUENT"
    priorityField = "NONE"
    cellSize = "0.035714286"
# Execute ExtractValuesToPoints
    saveRaster = arcpy.PointToRaster_conversion( filename2, value, outRaster2, assignmentType, priorityField, cellSize)

print " "
print ":o) End Processing :)"
print arcpy.GetMessages()






but i got it,

Traceback (most recent call last):
  File "C:\Users\Administrator\Desktop\arcpy\convert", line 33, in <module>
    saveRaster = arcpy.PointToRaster_conversion( filename2, value, outRaster2, assignmentType, priorityField, cellSize)
  File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 1772, in PointToRaster
    raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000840: The value is not a Raster Dataset.
ERROR 000840: The value is not a Raster Catalog.
Failed to execute (PointToRaster).





help me...TT
0 Kudos
T__WayneWhitley
Honored Contributor
Oh, now I think I see the problem, although you may have more than one problem - I'll tell you what I think is the most likely candidate 1st.  Is it true that you are listing point shapefiles for the input in the loop (even if it is just one iteration)?

The thing is, if a shp, the file has of course a .shp extension - you're feeding this into the output name.  Your output location was specified as "C:/py2/result" and to that you're joining the input filename which is going to balk at the .shp extension...so if you strip that off, I think you may be okay --- you can do that something like the following, replacing your outRaster2 variable line in the loop:

outRaster2 = os.path.join(OutputFolder2, os.path.splitext(filename2)[0])


(that's GRID raster format; for jpg, etc, add the necessary supported file format extension, as in):

outRaster2 = os.path.join(OutputFolder2, os.path.splitext(filename2)[0] + '.jpg')


Sorry didn't see that sooner!
Two other things I question is the 'NONE' parameter value, maybe should be an empty string '', and I agree with the cell size as suggested before this post - should probably be numeric.  If you run into further problems, maybe you should try leaving off some of these optional parameters to make sure it runs in minimal (or default) fashion at 1st.  Then continue testing adding in your 'fine tuning' params to get just the output you desire.

Hope that helps.

-Wayne
0 Kudos