Your code specified you shape file in "K:/STATE_MUKEY/AREA.gdb", which is obviously wrong. You should specify the full path of your shape file (wherever that is). like this inFeature = "K:/STATE_MUKEY/soilmu_in.shp"
inFeature = "K:/STATE_MUKEY/soilmu_in.shp"
Thanks your reply. These is exist! Please see the attachment. I mentioned before, I converted this file to raster using ArcTool box.
hzhu is correct. You are specifying a shapefile rather than a feature class. Change:inFeature = "soilmu_in.shp"toinFeature = "soilmu_in"
inFeature = "soilmu_in.shp"
inFeature = "soilmu_in"
You set up arcpy.env.workspace = "K:/STATE_MUKEY/AREA.gdb" and inFeature = "soilmu_in.shp". Basically you are telling arcpy to find soilmu_in.shp in K:/STATE_MUKEY/AREA.gdb, which does not exist.
I am trying to convert a shape file to raster by a python script. But it did not work. However, this conversion was done successfully by ArcToolBox. I used similar parmeters for raster conversion in the script - but I have got following errors. Any idea? # print arcpy.GetMessagesTraceback (most recent call last): File "K:\SCRIPT\Python_Script\ShapeToRaster.py", line 22, in <module> arcpy.FeatureToRaster_conversion(inFeatures, field, outRaster, cellSize) File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 1686, in FeatureToRaster raise eExecuteError: Failed to execute. Parameters are not valid.ERROR 000860: Input features: is not the type of Composite Geodataset, or does not exist.ERROR 001000: Field: Field MUKEY does not existFailed to execute (FeatureToRaster).---------------------------------------------------------------------# Import system modulesimport arcpy, os,sys## Set environment settingsarcpy.env.workspace = "K:/STATE_MUKEY/AREA.gdb"## Set local variablesinFeature = "soilmu_in.shp"field = "MUKEY"outRaster = "K:/STATE_MUKEY/RASTER.gdb/soilmu_in"#assignmentType = "CELL_CENTER"#priorityField = "NONE"cellSize = 90# Execute FeatureToRasterarcpy.FeatureToRaster_conversion(inFeature, field, outRaster, cellSize)print arcpy.GetMessages
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.