X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 29 Aug 2011 06:11 AM by  Deleted User
Adding Landsat Gap Fill Tool in ArcToolbox
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

Deleted User



New Member


Posts:24
New Member


--
29 Aug 2011 06:11 AM
    Hi,






    I want to add an ENVI Tool in ArcToolbox so that I can perform Landsat Gap Fill in ArcGIS without opening ENVI.
    I have written a python script (LandsatGapfill.py) to call 'LandsatGapfill.sav' from ArcMap. python script is mentioned below: # Python Code example for calling an ENVI DOIT Routine

    import arcgisscripting, envipy

    # Get input raster

    inRasterName = arcpy.GetParameterAsText(0)

    # Get output raster

    outRasterName = arcpy.GetParameterAsText(1)

    # IDL procedure name in the SAVE file for this tool

    toolname = 'LandsatGapfill'

    # Execute ENVI custom tool

    # If the save file is not in the same directory as this python

    # file, then you will need to add a full path to the save file e.g.,

    # Library = r'c:\savefiles\MyEnviTool.sav'

    envipy.RunTool(toolname, inRasterName, outRasterName,

    Library=r'LandsatGapfill.sav')
    I put 'LandsatGapfill.py' and 'LandsatGapfill.sav' both file in a same folder (GapfillTool) in C drive
    I have added tool in ArcToolbox using the properties mentioned below:
    Source file = LandsatGapfill.py
    Parameter: Input Raster = Raster Layer; Output Raster = Raster Dataset
    When I tried to run the Tool it is giving an error message, which is given below: Executing: myscript D:\Landsat\test.dat D:\Landsat\pp

    Start Time: Mon Aug 29 16:56:05 2011

    Running script myscript...

    Starting ENVI process.

    STRING = 'Attempt to call undefined procedure/function: 'LANDSATGAPFILL'.'

    Completed script myscript...

    Failed to execute (myscript).

    Failed at Mon Aug 29 16:57:14 2011 (Elapsed Time: 1 minutes 9 seconds)

    Please help me so that I can perform Landsat Gapfill in ArcGIS



    Regards,



    Partha Ghosh



    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    29 Aug 2011 07:33 AM
    This tool is written as a GUI program that gives you three choices and brings up various widgets. You need a program that is written in a batch mode in order to call it from ArcGIS. The Landsat Gapfill program would have to be re-written in a batch form to do this.

    Deleted User



    New Member


    Posts:24
    New Member


    --
    29 Aug 2011 10:44 AM
    Hi Mari M, Thanks! Could you please help me sharing a python script to call an existing ENVI routine (any routine) in ArcGIS. Is it possible to call FLAASH? Regards, Partha Ghosh

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    29 Aug 2011 10:50 AM
    FLAASH cannot be called in a batch routine. You can find an example IDL .pro code with python script in the ENVI for ArcGIS® help document for ENVI 4.8 under Authoring Custom Tools Tutorial.
    You are not authorized to post a reply.