0

I am writing a Python script to try to clip a raster generated by Idw_3d interpolation, but it's throwing the infamous 000732 error. I've looked at my file path, and it does exist there. I've opened it up with ArcMap, and it's there. However, I still get the error saying: ERROR 000732: Input Features: Dataset precipNew does not exist or is not supported

Note: I'm using IDLE for my IDE.

Here is my code:

import arcpy
from arcpy import env
#Not the actual workspace, it has been changed for this example
env.workspace = "C:\\Documents\\WeatherData.shp"
env.overwriteOutput = True
arcpy.CheckOutExtension("3d")
#arcpy.ListFeatureClasses() indicates that all of the data is present that I need to work with.
#Declare local variables
precipPoints = "PrecipMontana2014"
#Make feature class for the points to be interpolated
arcpy.MakeFeatureLayer_management(points, "points_lyr")
#IDW
arcpy.Idw_3d(in_point_features ="points_lyr", z_field = "RASTERVALU", out_raster = "precipNew")
####Everything works fine until this point, when I try to clip it####
#MontanaBoundary is the boundary I want to clip the IDW raster to
arcpy.Clip_analysis(in-features = "precipNew", clip_features = "MontanaBoundary", out_feature_class = "output1")

The error then throws after this line.

asked Oct 21, 2019 at 22:42
2
  • I should have proofread it better, it should be arcpy.MakeFeatureLayer_management(precipPoints, "points_lyr"), sorry about that. Commented Oct 21, 2019 at 22:44
  • Thank you, I didn't see that. Commented Oct 22, 2019 at 1:30

1 Answer 1

2

Use arcpy.Clip_management() to clip a raster, not arcpy.Clip_analysis() which is for clipping a vector feature class.

See: Clip (vector) documentation

and: Clip (raster) documentation

answered Oct 21, 2019 at 23:10
2
  • I tried that, both in the IDLE shell and creating a script, but I always get the RESTART: Shell notification. Would you happen to know why that would happen? It always wants to restart (without completing the process) when I run the arcpy.Clip_management process. Commented Oct 22, 2019 at 1:44
  • 1
    You may need to post your full code (perhaps as a separate new question). Commented Oct 22, 2019 at 1:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.