Re: [gdal-dev] gdal_calc.py Does Not Work on Mac

2022-06-28 Thread Chao Li
Hi, "brew install gdal" does work. I did it before, the problem is that I forget to add the PATH of gdal and the default PATH is to Anaconda. Now, it works :D Thank you. Andreas Oxenstierna 于2022年6月28日周二 15:28写道: > Hi > > My gdal installation with brew, https://formulae.brew.sh/formula/gdal,

Re: [gdal-dev] gdal_calc.py Does Not Work on Mac

2022-06-27 Thread Andreas Oxenstierna
Hi My gdal installation with brew, https://formulae.brew.sh/formula/gdal, do work on macOS: which gdal_calc.py /usr/local/bin/gdal_calc.py ls -l /usr/local/bin/gdal_calc* /usr/local/bin/gdal_calc.py -> ../Cellar/gdal/3.3.2_3/bin/gdal_calc.py Do you have to use Anaconda? Best Regards Andreas

[gdal-dev] gdal_calc.py Does Not Work on Mac

2022-06-27 Thread Chao Li
Hi, I meet a problem when I use gdal_calc.py on mac: (base) lichao@riushios-MacBook-Pro ~ % gdal_calc.py Traceback (most recent call last): File "/Users/lichao/opt/anaconda3/lib/python3.9/site-packages/osgeo/__init__.py", line 29, in swig_import_helper return importlib.import_module(mnam

Re: [gdal-dev] gdal_calc.py improvments

2020-06-24 Thread Even Rouault
On jeudi 25 juin 2020 00:35:24 CEST Idan Miara wrote: > Hi all, > > I've added some additions/improvements to gdal_calc.py > https://github.com/talos-gis/gdalos/blob/master/src/gdalos/calc/gdal_calc.py > > > 1. Alphalist now includes lower case letters. > 2. added hideNoData option to ignore noD

[gdal-dev] gdal_calc.py improvments

2020-06-24 Thread Idan Miara
Hi all, I've added some additions/improvements to gdal_calc.py https://github.com/talos-gis/gdalos/blob/master/src/gdalos/calc/gdal_calc.py 1. Alphalist now includes lower case letters. 2. added hideNoData option to ignore noDataValues 3. accept gdal datasets and pathlib.Path objects as alternat

[gdal-dev] gdal_calc.py: multiply each band of a multispectral raster by a factor

2018-12-18 Thread Agustin Lobo
Dear devs, Is it possible to use gdal_calc.py to multiply each band of a multispectral raster by a factor? I've tried: gdal_calc.py -A ReflPCA.tif --allBands=A --outfile=result.tif --calc="A*[1,2,3,4,5,6]" --overwrite it works fine with 1 single value, gdal_calc.py -A ReflPCA.tif --allBands=A --o

Re: [gdal-dev] gdal_calc.py floating point arithmetic

2016-07-15 Thread Sam Wilson
Thank you Andrew! That did it. Cheers, Sam On 7/14/16, 11:12 PM, "Andrew C Aitchison" wrote: >On Fri, 15 Jul 2016, Sam Wilson wrote: > >> Hi, >> >> I¹m attempting to linearly interpolate two geotiff files using >>gdal_calc.py. The geotiff files are 3 hours apart, so for example hour >>0 and

Re: [gdal-dev] gdal_calc.py floating point arithmetic

2016-07-15 Thread Antonio Falciano
Il 15/07/2016 02:13, Sam Wilson ha scritto: Hi, I’m attempting to linearly interpolate two geotiff files using gdal_calc.py. The geotiff files are 3 hours apart, so for example hour 0 and hour 3. I’d like to end up with hourly data, so I need hours 1 and 2. Below are the commands I’m using:

Re: [gdal-dev] gdal_calc.py floating point arithmetic

2016-07-14 Thread Andrew C Aitchison
On Fri, 15 Jul 2016, Sam Wilson wrote: Hi, I’m attempting to linearly interpolate two geotiff files using gdal_calc.py. The geotiff files are 3 hours apart, so for example hour 0 and hour 3. I’d like to end up with hourly data, so I need hours 1 and 2. Below are the commands I’m using: Ho

[gdal-dev] gdal_calc.py floating point arithmetic

2016-07-14 Thread Sam Wilson
Hi, I’m attempting to linearly interpolate two geotiff files using gdal_calc.py. The geotiff files are 3 hours apart, so for example hour 0 and hour 3. I’d like to end up with hourly data, so I need hours 1 and 2. Below are the commands I’m using: gdal_calc.py -A hour0.tif -B hour3.tif —outf

Re: [gdal-dev] gdal_calc.py IF ELSE Condition

2016-07-01 Thread Gabriele N.
Ciao Antonio. Now everything looks perfect. Thank you very much Gabriele -- View this message in context: http://osgeo-org.1560.x6.nabble.com/gdal-calc-py-IF-ELSE-Condition-tp5274166p5274365.html Sent from the GDAL - Dev mailing list archive at Nabble.com. __

Re: [gdal-dev] gdal_calc.py IF ELSE Condition

2016-06-30 Thread Antonio Falciano
Il 30/06/2016 15:47, Gabriele N. ha scritto: Ciao Antonio. @arctan I think is ok. It works but there are many negative values...I must investigate :) Meanwhile thanks Gabriele, the previous expression has some errors yet: two parenthesis and a conversion are missing. This should be the r

Re: [gdal-dev] gdal_calc.py IF ELSE Condition

2016-06-30 Thread Gabriele N.
Ciao Antonio. @arctan I think is ok. It works but there are many negative values...I must investigate :) Meanwhile thanks Gabrlele -- View this message in context: http://osgeo-org.1560.x6.nabble.com/gdal-calc-py-IF-ELSE-Condition-tp5274166p5274178.html Sent from the GDAL - Dev mailing

Re: [gdal-dev] gdal_calc.py IF ELSE Condition

2016-06-30 Thread Antonio Falciano
Il 30/06/2016 15:25, Gabriele N. ha scritto: Hi all, my goal is to apply the following condition: if map A > 0 then MAP C = arctan((A/B)+180 ELSE MAP C = 90-arctan(A/B) I tried in several ways, including this: gdal_calc.py -A u-wind$DATE.tif -B v-wind$DATE.tif --outfile=dir_wind_$DATE.tif -

[gdal-dev] gdal_calc.py IF ELSE Condition

2016-06-30 Thread Gabriele N.
Hi all, my goal is to apply the following condition: if map A > 0 then MAP C = arctan((A/B)+180 ELSE MAP C = 90-arctan(A/B) I tried in several ways, including this: gdal_calc.py -A u-wind$DATE.tif -B v-wind$DATE.tif --outfile=dir_wind_$DATE.tif --calc="arctan(A/B)+180*(A>0) w_dir=90-arctan(A/

Re: [gdal-dev] gdal_calc.py gives different answers

2016-01-04 Thread Ari Jolma
I have no experience with gdal_calc.pv nor do I know about its internals anything beside it being implemented with numpy. So I comment this only from a general point of view. 05.01.2016, 09:00, Avyav Kumar kirjoitti: This is a rather interesting error, which is listed here (https://trac.osgeo.

Re: [gdal-dev] gdal_calc.py gives different answers

2016-01-04 Thread Avyav Kumar
This is a rather interesting error, which is listed here ( https://trac.osgeo.org/gdal/ticket/5478). While getting the intermediate calculations of the raster band for A and B, I noticed the following - For --calc="A*20+B", the raster formed as the result of the addition of A*20 and B is not equa

Re: [gdal-dev] Gdal_calc.py with more than 26 input files

2015-07-23 Thread Graeme B. Bell
On 17 Jul 2015, at 12:09, wrote: > Have a look at this gis.stackexchange question: > http://gis.stackexchange.com/questions/149006/does-gdal-calc-only-support-26-input-raster-files-at-a-time > > So, what users can do if they have more than 26 input files? (in case someone finds this via Goog

Re: [gdal-dev] Gdal_calc.py with more than 26 input files

2015-07-16 Thread Mike Toews
On 17 July 2015 at 11:58, Even Rouault wrote: > In your above example, only the first band of var_stacked.vrt will be used. So > basically you're computing the average of all lines of a block (possibly a > single line depending on the dataset), and this average line will be written > in the first

Re: [gdal-dev] Gdal_calc.py with more than 26 input files

2015-07-16 Thread Even Rouault
On Friday 17 July 2015 11:29:11 Mike Toews wrote: > On 17 July 2015 at 11:13, Even Rouault wrote: > > But when you have more than 26 input files, it is dubious that you really > > want to individually identify them with a particular letter/name. As in > > one of the examples, you likely just want

Re: [gdal-dev] Gdal_calc.py with more than 26 input files

2015-07-16 Thread Mike Toews
On 17 July 2015 at 11:13, Even Rouault wrote: > But when you have more than 26 input files, it is dubious that you really want > to individually identify them with a particular letter/name. As in one of the > examples, you likely just want to apply a global operation on them, like sum, > mean, ...

Re: [gdal-dev] Gdal_calc.py with more than 26 input files

2015-07-16 Thread Even Rouault
On Thursday 16 July 2015 20:38:44 Jukka Rahkonen wrote: > Hi, > > Have a look at this gis.stackexchange question: > http://gis.stackexchange.com/questions/149006/does-gdal-calc-only-support-26 > -input-raster-files-at-a-time > > So, what users can do if they have more than 26 input files? Hi Ju

[gdal-dev] Gdal_calc.py with more than 26 input files

2015-07-16 Thread Jukka Rahkonen
Hi, Have a look at this gis.stackexchange question: http://gis.stackexchange.com/questions/149006/does-gdal-calc-only-support-26-input-raster-files-at-a-time So, what users can do if they have more than 26 input files? -Jukka Rahkonen- ___ gdal-dev ma

Re: [gdal-dev] gdal_calc.py looses the color lookup table

2015-06-24 Thread Stephen Woodbridge
On 6/24/2015 8:59 AM, Even Rouault wrote: Le mercredi 24 juin 2015 03:49:15, Stephen Woodbridge a écrit : Hi All, I have a geotiff file like: [] ~/work/oceandata/test$ gdalinfo A2015173174000.L0_LAC.L2_OC.tif -noct Driver: GTiff/GeoTIFF Files: A2015173174000.L0_LAC.L2_OC.tif A20151731

Re: [gdal-dev] gdal_calc.py looses the color lookup table

2015-06-24 Thread Even Rouault
Le mercredi 24 juin 2015 03:49:15, Stephen Woodbridge a écrit : > Hi All, > > I have a geotiff file like: > > [] ~/work/oceandata/test$ gdalinfo A2015173174000.L0_LAC.L2_OC.tif -noct > Driver: GTiff/GeoTIFF > Files: A2015173174000.L0_LAC.L2_OC.tif > A2015173174000.L0_LAC.L2_OC.tif.aux.xml

[gdal-dev] gdal_calc.py looses the color lookup table

2015-06-23 Thread Stephen Woodbridge
Hi All, I have a geotiff file like: [] ~/work/oceandata/test$ gdalinfo A2015173174000.L0_LAC.L2_OC.tif -noct Driver: GTiff/GeoTIFF Files: A2015173174000.L0_LAC.L2_OC.tif A2015173174000.L0_LAC.L2_OC.tif.aux.xml Size is 2433, 1727 Coordinate System is: GEOGCS["WGS 84", DATUM["WGS_1984",

Re: [gdal-dev] gdal_calc.py: produce median raster

2014-11-26 Thread Pieter Kempeneers
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

Re: [gdal-dev] gdal_calc.py: produce median raster

2014-11-26 Thread Mike Toews
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: [gdal-dev] gdal_calc.py: produce median raster

2014-11-25 Thread Marius Jigmond
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

Re: [gdal-dev] gdal_calc.py: produce median raster

2014-11-25 Thread Simen Langseth
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

Re: [gdal-dev] gdal_calc.py: produce median raster

2014-11-25 Thread Chris Yesson
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

Re: [gdal-dev] gdal_calc.py: produce median raster

2014-11-24 Thread Simen Langseth
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

Re: [gdal-dev] gdal_calc.py: produce median raster

2014-11-24 Thread Simen Langseth
, 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

Re: [gdal-dev] gdal_calc.py: produce median raster

2014-11-24 Thread Marius Jigmond
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.

[gdal-dev] gdal_calc.py: produce median raster

2014-11-24 Thread Simen Langseth
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.

Re: [gdal-dev] gdal_calc.py and NoData issues

2014-11-20 Thread Graeme B. Bell
Andreas, >it turns out that all pixel values with 255 are now nodata values ;-( Is >there an option so that my 255 values are not turned into nodata? I >tested with the --NoDataValue option (e.g. 99 - which I don't use in the >image), but it seems to be ignored. For me it is important that blac

Re: [gdal-dev] gdal_calc.py and NoData issues

2014-11-19 Thread Andreas Neumann
Hi Simen, <> means not - same as != Andreas Am 2014-11-19 15:09, schrieb Simen Langseth: I saw the symbol <> first time in gdal calc what is meaning of it? Thanks On Wed, Nov 19, 2014 at 10:21 PM, Even Rouault wrote: Le mercredi 19 novembre 2014 14:16:05, Andreas Neumann a écrit : Hi Eve

Re: [gdal-dev] gdal_calc.py and NoData issues

2014-11-19 Thread Simen Langseth
I saw the symbol <> first time in gdal calc what is meaning of it? Thanks On Wed, Nov 19, 2014 at 10:21 PM, Even Rouault wrote: > Le mercredi 19 novembre 2014 14:16:05, Andreas Neumann a écrit : > > Hi Even, > > > > Thank you for trying to help. Unfortunately, the --overwrite option does > > no

Re: [gdal-dev] gdal_calc.py and NoData issues

2014-11-19 Thread Andreas Neumann
oh - sorry. This helps. Correct syntax is: gdal_calc.py -A test.tif --overwrite --NoDataValue=99 --outfile=testcalc.tif --calc="(A==249)*255+(A<>249)*A" Thanks a lot! Andreas Am 2014-11-19 14:21, schrieb Even Rouault: Le mercredi 19 novembre 2014 14:16:05, Andreas Neumann a écrit : Hi Even

Re: [gdal-dev] gdal_calc.py and NoData issues

2014-11-19 Thread Even Rouault
Le mercredi 19 novembre 2014 14:16:05, Andreas Neumann a écrit : > Hi Even, > > Thank you for trying to help. Unfortunately, the --overwrite option does > not help. > > I have a very small test file at http://webgis.uster.ch/temp/test.tif > > I used the following options: > > gdal_calc.py -A te

Re: [gdal-dev] gdal_calc.py and NoData issues

2014-11-19 Thread Even Rouault
Le mercredi 19 novembre 2014 13:49:48, Andreas Neumann a écrit : > Hi, > > I have an issue with gdal_calc.py and nodata values. > > My input data contains a lot of white pixels. After running gdal_calc.py > with the following parameters > > gdal_calc.py -A test.tif --outfile=testcalc.tif > --cal

[gdal-dev] gdal_calc.py and NoData issues

2014-11-19 Thread Andreas Neumann
Hi, I have an issue with gdal_calc.py and nodata values. My input data contains a lot of white pixels. After running gdal_calc.py with the following parameters gdal_calc.py -A test.tif --outfile=testcalc.tif --calc="(A==249)*255+(A<>249)*A" it turns out that all pixel values with 255 are n

Re: [gdal-dev] gdal_calc.py else not 0

2014-09-19 Thread Benjamin_P
I am posting a response I got from Graeme B. Bell: To get "1 if zero, or A" you do: --calc="(A==0)*1 + (A>0)*A" Don't make 1 your nodata value if it's actually a data value here G -- View this message in context: http://osgeo-org.1560.x6.nabble.com/gdal-calc-py-else-not-0-tp5162590p5162914

Re: [gdal-dev] gdal_calc.py else not 0

2014-09-18 Thread Benjamin_P
I found a workaround for my problem: First get all zeros in the original file with: gdal_calc.py -A original_file.tif --outfile=zeros.tif --calc=A==0 --> results in a file where ther former zero cells have a value of 1 and all other cells 0 Then combine the temporary file with the original file:

[gdal-dev] gdal_calc.py else not 0

2014-09-18 Thread Benjamin_P
I am trying to reassign 0 values in my raster to 1 and leave all the other values as they are. gdal_calc.py -A infile.tif --outfile=outfile.tif --calc="A* logical_or(A < 0, A > 0)" --overwrite --NoDataValue=1 The problem I am encountering is, that I cannot reassign the zeros. In my calculation I

Re: [gdal-dev] gdal_calc.py not saving correct statistics (min/max) to new rasters in some cases?

2014-06-27 Thread Chaitanya kumar CH
Patrick, Can you send me the sample data? -- Best regards, Chaitanya Kumar CH On 27-Jun-2014 9:56 am, "Patrick Sunter" wrote: > No comments on the below anyone? > > It does seem like a genuine bug that gdal_calc.py can produce output with > statistics not up to date? > > Should I create an issue

Re: [gdal-dev] gdal_calc.py not saving correct statistics (min/max) to new rasters in some cases?

2014-06-26 Thread Patrick Sunter
No comments on the below anyone? It does seem like a genuine bug that gdal_calc.py can produce output with statistics not up to date? Should I create an issue in the issue tracker? -- Patrick. On Thu, Jun 19, 2014 at 2:45 PM, Patrick Sunter wrote: > Hi there, > > I've been using gdal_calc.py

[gdal-dev] gdal_calc.py - new optional feature / performance improvement

2013-06-21 Thread Graeme B. Bell
Hi, This may be of use to anyone who regularly uses gdal_calc.py. http://trac.osgeo.org/gdal/ticket/5130 - easy patch - you can get a performance boost of up to 33% depending on how you use gdal_calc or the type of data you have - you can handle nodata processing with more flexibility if you

[gdal-dev] gdal_calc.py, calculating the mean value of masked arrays

2011-09-29 Thread christian yrrman
Dear All, I'm trying to use gdal_calc.py to solve the following problem: I have a time series of NDVI data as 8bit tiff files with different BadData pixels (>50 and <250; this is the same for all layers) from which I would like to calculate the mean. (i.e. the same pixel might not be valid in al

Re: [gdal-dev] gdal_calc.py

2010-09-20 Thread Vincent Schut
e: Hi Chris, That sounds good. Is that by any chance based on this idea here: [http://trac.osgeo.org/gdal/wiki/SummerOfCode]? Regards, Ivan ---Original Message--- From: Chris Yesson To: gdal-dev@lists.osgeo.org Subject: [gdal-dev] gdal_calc.py Sent: Sep 17 '10 0

Re: [gdal-dev] gdal_calc.py

2010-09-20 Thread Lucena, Ivan
- From: Chris Yesson To: gdal-dev@lists.osgeo.org Subject: [gdal-dev] gdal_calc.py Sent: Sep 17 '10 09:29 Hi all, I have been playing around with a python/gdalnumeric-based raster calculator for a while now (http://static.zsl.org/files/gdal-calc-1218.py). I thought i

Re: [gdal-dev] gdal_calc.py

2010-09-20 Thread Vincent Schut
---Original Message--- From: Chris Yesson To: gdal-dev@lists.osgeo.org Subject: [gdal-dev] gdal_calc.py Sent: Sep 17 '10 09:29 Hi all, I have been playing around with a python/gdalnumeric-based raster calculator for a while now (http://static.zsl.org/files/gdal-calc-1218.p

Re: [gdal-dev] gdal_calc.py

2010-09-17 Thread Howard Butler
On Sep 17, 2010, at 9:29 AM, Chris Yesson wrote: > Hi all, > > I have been playing around with a python/gdalnumeric-based raster calculator > for a while now (http://static.zsl.org/files/gdal-calc-1218.py). > I thought it was time to try to share this properly via GDAL. > > Could this go on

Re: [gdal-dev] gdal_calc.py

2010-09-17 Thread Ivan Lucena
Hi Chris, That sounds good. Is that by any chance based on this idea here: [http://trac.osgeo.org/gdal/wiki/SummerOfCode]? Regards, Ivan > ---Original Message--- > From: Chris Yesson > To: gdal-dev@lists.osgeo.org > Subject: [gdal-dev] gdal_calc.py > Sent: S

[gdal-dev] gdal_calc.py

2010-09-17 Thread Chris Yesson
Hi all, I have been playing around with a python/gdalnumeric-based raster calculator for a while now (http://static.zsl.org/files/gdal-calc-1218.py). I thought it was time to try to share this properly via GDAL. Could this go on the sample python scripts directory? Could I get advice on