point to raster, i got the error..

1467
2
05-19-2013 05:42 AM
LEEjongseok
New Contributor
###########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()



my point shp file, attribute table.
..[ATTACH=CONFIG]24481[/ATTACH]






i got this error

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 000728: Field RasterValu  does not exist within table
ERROR 000840: The value is not a Raster Dataset.
ERROR 000840: The value is not a Raster Catalog.
Failed to execute (PointToRaster).
Tags (2)
0 Kudos
2 Replies
T__WayneWhitley
Frequent Contributor
After just a cursory look, it appears you are feeding the wrong data type into the point to raster tool...so looking backwards, I see you're using ListFeatureClasses to feed into your loop, so I'd check the list to make sure you're feeding in the appropriate data... or, check that the field exists - looks like that is not quite right, RasterValu...

Hope that helps,
Wayne
0 Kudos
T__WayneWhitley
Frequent Contributor
See your other thread:
http://forums.arcgis.com/threads/84656-ExecuteError-ERROR-999999-Error-executing-function.?p=299612#...

In the version of code you posted here, you actually have multiple problems, one of which is the specified fieldname must match in case, i.e. all caps as it is in your table, RASTERVALU.  Also, there was a problem specifying your output raster name.  ...and there may be other problems too, but let's start with that.

Wayne
0 Kudos