By Ali


2016-07-29 09:33:01 8 Comments

The solution already available online gives a python syntax error

ERROR 000989

Python syntax error: Parsing error SyntaxError: invalid syntax (line 1)

when I write

$$rowmap + 1

in map algebra expression.

1 comments

@user2856 2016-07-29 09:50:33

The $$RowMap, $$ColMap, $$XMap and $$YMap variables (and some others) are no longer (directly) supported as of ArcGIS 10.0.

You can use it via python:

arcpy.env.extent = arcpy.Extent(0, 0, 10, 10)  #Change to suit
# Or
arcpy.env.extent = "path to raster"
arcpy.env.cellSize = 1    #Change to suit
arcpy.gp.SingleOutputMapAlgebra_sa("$$ROWMAP + 1"), "output_raster")  

See also this answer and this GeoNet post.

Related Questions

Sponsored Content

2 Answered Questions

[SOLVED] ArcMap Python Code gives SyntaxError?

1 Answered Questions

[SOLVED] arcpy for loop to save shapefiles as .layer files

3 Answered Questions

[SOLVED] Deleting selected rows in ArcPy?

1 Answered Questions

[SOLVED] indentation problem or function problem?

2 Answered Questions

1 Answered Questions

1 Answered Questions

[SOLVED] Raster Calculator Parsing Error

Sponsored Content