вычесть и разделить на растровые каналы в arcpy.gp.RasterCalculator - PullRequest
0 голосов
/ 07 мая 2020

Я был бы очень признателен за помощь с этим скриптом. Я явно что-то не так делаю. Я пытаюсь работать с полосами с помощью arcpy.gp.RasterCalculator. Я пытаюсь создать изображение индекса растительности. Это то, что я сделал.

# Import arcpy module
import arcpy

# Define Enviornment
arcpy.env.workspace = arcpy.GetParameterAsText(0)

arcpy.env.overwriteOutput = True

# Script arguments
band8 = arcpy.GetParameterAsText(1)
if band8 == '#' or not band8:
    band8 = "C:\\egm722\\band8_clp.jp2" # provide a default value if unspecified

band4 = arcpy.GetParameterAsText(2)
if band4 == '#' or not band4:
    band4 = "C:\\egm722\\band4_clp.jp2" # provide a default value if unspecified

# Local variables:
NDVi = "C:\\egm722\\ndvi.img"

# Process: Raster Calculator
arcpy.gp.RasterCalculator_sa("Float(\"%band8%\" - \"%band4%\") / (\"%band8%\" + \"%band4%\")", NDVi)

, но я получаю это сообщение об ошибке

Start Time: Thu May 07 00:03:19 2020
Running script veg...
Failed script veg...
SyntaxError: unexpected character after line continuation character (NVD2I_arcpy_script_Variables_RASTERCALCULATOR.py, line 31)
Failed to execute (veg).
Failed at Thu May 07 00:03:19 2020 (Elapsed Time: 0.14 seconds) ```

I would be extremely grateful. Thanks your time. 

...