Simen,
In case you can not find a solution with gdal_calc.py, you could try to use
pkfilter from pktools (http://pktools.nongnu.org). Once installed
(currently under Linux only), you can produce your median raster as follows:
pkfilter -i infile -o outfile -dz 1 -f median
The option -dz 1 indicat
Hi Simen,
Try this:
gdal_calc.py -A rgb.tif --outfile ouput.tif --calc "median(A, axis=0)"
The "axis=0" parameter is to perform a median calculation along the
first dimension, which is the band dimension. Lean more here:
http://docs.scipy.org/doc/numpy/reference/generated/numpy.median.html
-Mik
re results.
-marius
Date: Tue, 25 Nov 2014 17:56:46 +0900
From: simlan...@gmail.com
To: chris.yes...@ioz.ac.uk
CC: gdal-dev@lists.osgeo.org
Subject: Re: [gdal-dev] gdal_calc.py: produce median raster
Dear Dr Chris Yesson
Thanks for your quick response.
I got the following error:
ValueError: The truth v
gt;>>
>>> I hope someone can help me.
>>>
>>> On Tue, Nov 25, 2014 at 12:09 PM, Marius Jigmond <
>>> mariusjigm...@hotmail.com> wrote:
>>>
>>>> Does the following work:
>>>>
>>>> gdal_calc.py -A infile --al
t; wrote:
>>
>>> Does the following work:
>>>
>>> gdal_calc.py -A infile --allBands=A --outfile=outfile --calc="median(A)"
>>>
>>>
>>> --
>>> Date: Mon, 24 Nov 2014 19:14:06 +0900
>>> From: simlan...@g
t;>
>> gdal_calc.py -A infile --allBands=A --outfile=outfile --calc="median(A)"
>>
>>
>> --
>> Date: Mon, 24 Nov 2014 19:14:06 +0900
>> From: simlan...@gmail.com
>> To: gdal-dev@lists.osgeo.org
>> Subject: [gda
, Marius Jigmond
wrote:
> Does the following work:
>
> gdal_calc.py -A infile --allBands=A --outfile=outfile --calc="median(A)"
>
>
> --
> Date: Mon, 24 Nov 2014 19:14:06 +0900
> From: simlan...@gmail.com
> To: gdal-dev@lists.osgeo.o
Does the following work:
gdal_calc.py -A infile --allBands=A --outfile=outfile --calc="median(A)"
Date: Mon, 24 Nov 2014 19:14:06 +0900
From: simlan...@gmail.com
To: gdal-dev@lists.osgeo.org
Subject: [gdal-dev] gdal_calc.py: produce median raster
I have one GeoTiff file with 3 bands.
I have one GeoTiff file with 3 bands. I want to produce a raster file
computing pixel wise median value for the three raster bands. How can I do
that?
I tried as follows:
gdal_calc.py -A infile --allBands --outfile outfile --calc median(A)
But could not get any out file.