0

I am importing a raster file and then saving the layer file. This script has worked fine previously, but after changing some input file paths, it has stopped working. Arc finds the inputs, but then has an error code at the make raster layer point related to the input parameters: error codes 000622 and 000628. After making the raster layer I save the layer file, and do other steps, but I have only included the script to the point where it fails.

    # Import arcpy module
    import arcpy

    # Import system modules
    import sys, string, os, arcgisscripting

    # Create the Geoprocessor object
    gp = arcgisscripting.create()
    gp.Overwriteoutput = 1

    # Set Workspace
    arcpy.env.workspace = r"S:\Map_Creation"

    # Set overwrite option
    arcpy.env.overwriteOutput = True


    # Local variables:
    InputRaster = "C:\\Asc_Conversion\\rasters\\r001d1b1_dr0"
    ExtentFile = "S:\\01.RIM\\Final_Extent_Outputs\\r001d1b1_ext_r0.shp"
    RasLayerTemp = "Depth"

    # Process: Make Raster Layer
    arcpy.MakeRasterLayer_management(InputRaster, RasLayerTemp, "", ExtentFile, "")
  • What do you get from arcpy.GetMessages() after the MakeRasterLayer_management step? Could you also include the full details of the two error codes you receive? – smiller Jun 27 '18 at 13:29
  • The errors are <class 'arcgisscripting.ExecuteError'>: ERROR 000622: Failed to execute (Make Raster Layer). Parameters are not valid. ERROR 000628: Cannot set input into parameter envelope. Failed to execute (Script1). – siobhan Jun 27 '18 at 13:43
  • What version of ArcGIS Desktop you are on? – Alex Tereshenkov Jun 27 '18 at 13:48
  • Its version 10.0 – siobhan Jun 27 '18 at 13:50
  • So the envelope parameter is related to your ExtentFile. You said this worked with different inputs; is this the same ExtentFile moved to a new location or is it a different shapefile entirely? What if you move the original shapefile to this location and test? – smiller Jun 27 '18 at 13:53
1

The ERROR 000628: Cannot set input into parameter envelope. Failed to execute error indicates that the wrong data type is being used for a parameter, specifically the envelope parameter for this tool.

On at least one code example (in version 9.3) the envelope is a set of extent numbers separated by spaces. Try to either modify to use specific numbers or get the extent of that shapefile via Describe. Pass the extent to Make Raster Layer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.