Say I have 2 rasters with same spatial extent and same resolution and same number of classes:

Raster 1: Ground Truth.

Raster 2: Result of some algorithm.

I want to see what % of pixels have same value. To achieve this I tried following in raster calculator

outras = Con("ras1.tif" = "ras2.tif", 1,0)

I am getting error:

Runtime error SyntaxError: keyword can't be an expression

closed as off-topic by ahmadhanb, Andre Silva, LaughU, BERA, whyzar Apr 23 at 15:39

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This problem cannot or can no longer be reproduced. Changes to the system or to the asker's circumstances may have rendered the question obsolete, or the question does not include a procedure to enable potential answerers to reproduce the same symptoms. Such questions are off-topic as they are unlikely to help future readers, but editing them to include more details can lead to re-opening." – ahmadhanb, Andre Silva, LaughU, BERA, whyzar
If this question can be reworded to fit the rules in the help center, please edit the question.

  • How about subtracting one from the other and then check the histogram for the frequency of 0 value? – kowalski Mar 22 at 11:25
  • Replace = by == – FelixIP Mar 22 at 20:11

Replace = by == – FelixIP

^ This works

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