Quantcast
Channel: Question and Answer » gdal
Viewing all articles
Browse latest Browse all 397

Conditional statement in gdal_calc with result as float, not boolean

$
0
0

Many examples on gis.se that refer to gdal_calc give a boolean example.
example 1
example 2

If I need to calculate a conditional statement on a float:

If Raster_Value >= 1024, then 1024; else Raster_Value.

How do I perform that operation in the gdal raster calculator command line

EDIT
I tried radouxju answer and it worked, except for the cell values that didn’t.
here are 3 kinds of results I got

enter image description here

Here is the tool gui and the parameters I’ve entered
enter image description here


Viewing all articles
Browse latest Browse all 397

Trending Articles