TransWikia.com

Using Raster calculator gives ERROR 000539

Geographic Information Systems Asked by Paul Colomb on September 3, 2021

I’m new with ArcGIS. I would like to do a calculate of NDWI. So I’m using Arctoolbox => Spatial analyst tools => Map Algebra => Raster calculator.

But when I’m trying to perform it, I get this error :

Executing: RasterCalculator "Float("LT05_L1TP_196030_19990113_20180215_01_T1_sr_band2.tif" - "LT05_L1TP_196030_19990113_20180215_01_T1_sr_band5.tif") / Float("LT05_L1TP_196030_19990113_20180215_01_T1_sr_band2.tif" + "LT05_L1TP_196030_19990113_20180215_01_T1_sr_band5.tif")" D:UserspaulcDocumentsSIG_ZHMNDWI1999_01_13_NDWI.tif
Start Time: Thu Oct 24 15:42:34 2019
Float(Raster(r"LT05_L1TP_196030_19990113_20180215_01_T1_sr_band2.tif") - Raster(r"LT05_L1TP_196030_19990113_20180215_01_T1_sr_band5.tif")) / Float(Raster(r"LT05_L1TP_196030_19990113_20180215_01_T1_sr_band2.tif") + Raster(r"LT05_L1TP_196030_19990113_20180215_01_T1_sr_band5.tif"))

ERROR 000539: Error running expression: rcexec() 
Traceback (most recent call last):
  File "<expression>", line 1, in <module>
  File "<string>", line 2, in rcexec
  File "c:program files (x86)arcgisdesktop10.3arcpyarcpy__init__.py", line 21, in <module>
    from arcpy.geoprocessing import gp
  File "c:program files (x86)arcgisdesktop10.3arcpyarcpygeoprocessing__init__.py", line 14, in <module>
    from _base import *
  File "c:program files (x86)arcgisdesktop10.3arcpyarcpygeoprocessing_base.py", line 598, in <module>
    env = GPEnvironments(gp)
  File "c:program files (x86)arcgisdesktop10.3arcpyarcpygeoprocessing_base.py", line 595, in GPEnvironments
    return GPEnvironment(geoprocessor)
  File "c:program files (x86)arcgisdesktop10.3arcpyarcpygeoprocessing_base.py", line 548, in __init__
    import weakref
  File "D:Programmes (x86)PythonLibweakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref

Failed to execute (RasterCalculator).

How can I fix this?

I have already tried to change the wayfolder for a shorter way, without space or special character, but it’s still like there is a problem with the wayfolder.

One Answer

Rename the bands for the ndwi. say band 1, band2, band3, and band 4. Open python IDE in ArcMap, and type in * img 1 = arcpy.Raster("C:/band1(Path)") - Do for img 2, img 3 and img 4 * Ndwi =float( img 1 - img2)/ img 1 + img 2

This can be an alternative to raster calculator.

Answered by Terah Antwi on September 3, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP