Re: [Qgis-user] Raster calculator difference evaluation

2021-10-03 Thread Sebastian Gutwein
In case Nicolas' answer wasn't detailed enough I would use the SAGA invert data/no-data with the no-data value set to 1 on your raster A layer. This will create a mask with 1 in all the cells that were no-data and no-data in all the other cells. Then using the raster calculator run Mask Layer *

Re: [Qgis-user] Raster calculator difference evaluation

2021-10-03 Thread Nicolas Cadieux
Hi, I would create a mask with raster A where any value = 1 and nodata = 0. Then multiply the raster B by the mask. Anything that comes back as zero contains no data in raster A. Nicolas Cadieux https://gitlab.com/njacadieux > Le 3 oct. 2021 à 10:36, Davide Di Mauro a > écrit : > >  > Hi

[Qgis-user] Raster calculator difference evaluation

2021-10-03 Thread Davide Di Mauro
Hi all, I have two rasters. I need to output cells of one raster that are not present in the other. How would I go in order to achieve that using the raster calculator (i.e. avoiding Python)? My logic so far is: if A - B = A then output cells from A deriving from that evaluation and NoData

Re: [Qgis-user] Raster Calculator Error Questions

2021-02-15 Thread Wanda Norman
rectly when I > had more than one DEM. Everything ran without errors, but the result was > empty, except for a thin band where the two DEMs overlapped. You may need > to be careful to set this to the correct extent, so click on your Aspect > layer and then Selected Layer Extent. > > > >

Re: [Qgis-user] Raster Calculator Error Questions

2021-02-15 Thread Nicolas Cadieux
t being set correctly when I had > more than one DEM. Everything ran without errors, but the result was empty, > except for a thin band where the two DEMs overlapped. You may need to be > careful to set this to the correct extent, so click on your Aspect layer and > then Selected L

Re: [Qgis-user] Raster Calculator Error Questions

2021-02-13 Thread Thayer Young
========Date: Fri, 12 Feb 2021 14:12:49 -0500 From: Wanda Norman To: Nicolas Cadieux Cc: qgis-user Subject: Re: [Qgis-user] Raster Calculator Error Questions Message-ID:     Content-Type: text/plain; charset="utf-8" Thanks Nicolas for the qu

Re: [Qgis-user] Raster Calculator Error Questions

2021-02-12 Thread Andrea Giudiceandrea
Wanda Norman wrote > I tried: ( "aspect@1" < = 90) OR ( "aspect@1" > = 270) - I get > Expression is not valid. Hi Wanda, have you tried not putting spaces between the characters "<" and "=" and between ">" and "="? Regards. Andrea -- Sent from:

Re: [Qgis-user] Raster Calculator Error Questions

2021-02-12 Thread Wanda Norman
Thanks Nicolas for the quick response. But I am still having issues. I did upgrade to the 3.16 version and I am still unable to write the formula. I tried: ( "aspect@1" < = 90) OR ( "aspect@1" > = 270) - I get Expression is not valid. As soon as I put anything other than "aspect@1" I get a

Re: [Qgis-user] Raster Calculator Error Questions

2021-02-12 Thread Nicolas Cadieux
Hi, I have not used the raster calculator in a while but I am not sure about you use of the \. Examples in the user manual (https://docs.qgis.org/3.16/en/docs/user_manual/working_with_raster/raster_analysis.html#raster-calculator) use this as examples. ("elevation@1" < 50) * 1 + ("elevation@1"

[Qgis-user] Raster Calculator Error Questions

2021-02-12 Thread Wanda Norman
Greetings friends: I am working on lesson 7.3.5 in the User Guide / Manual (QGIS 3.10) – Following along: Using the Raster Calculator. I am having difficulty with the calculation formula as indicated below: The manual states this formula should be used: Aspect@1 <=90 OR

Re: [Qgis-user] Raster calculator

2019-05-23 Thread Raymond Nijssen
Hi Jocelyn, Sorry for not knowing the entire answer, but here are some steps. 1. Select all cells that are not white using the Raster Calculator: "test@1" != 255 or "test@2" != 255 or "test@3" != 255 2. Set all 0 values to nodata with GRASS r.null 3. This is where I'm stuck too. :( You

[Qgis-user] Raster calculator

2019-05-23 Thread Jocelyn Le Baut
Hello everybody, I have a problem to use the raster calculator. Some pixels of my geotiff file have the value 255 on the band 1, 2 and 3. I want to replace the value by 0 on the band 1, 2 and 3 for these pixels. I have try with this formula but it's not look good : ("test@1" != 255)+("test@2" !=

Re: [Qgis-user] Raster Calculator Crashing

2019-01-16 Thread GILLEN Finbar
[mailto:nicolas.cadi...@archeotec.ca] Sent: 16 January 2019 16:35 To: GILLEN Finbar Cc: Alessandro Pasotti ; qgis-user@lists.osgeo.org Subject: Re: [Qgis-user] Raster Calculator Crashing Hi, Comprising the file will probably not change anything. Either the matrix hight and width is too big for the memory

Re: [Qgis-user] Raster Calculator Crashing

2019-01-16 Thread Nicolas Cadieux
> will pass through the calculator. > > But in the meantime I will look into getting the latest version of QGIS. > > Thanks again, > Finbar > > From: Alessandro Pasotti [mailto:apaso...@gmail.com] > Sent: 16 January 2019 14:45 > To: GILLEN Finbar > Cc: qgis-

Re: [Qgis-user] Raster Calculator Crashing

2019-01-16 Thread GILLEN Finbar
. But in the meantime I will look into getting the latest version of QGIS. Thanks again, Finbar From: Alessandro Pasotti [mailto:apaso...@gmail.com] Sent: 16 January 2019 14:45 To: GILLEN Finbar Cc: qgis-user@lists.osgeo.org Subject: Re: [Qgis-user] Raster Calculator Crashing On Wed, Jan 16, 2019 at 3:41 PM

Re: [Qgis-user] Raster Calculator Crashing

2019-01-16 Thread Alessandro Pasotti
On Wed, Jan 16, 2019 at 3:41 PM GILLEN Finbar wrote: > Hi, > > > > I am using the Raster Calculator in QGIS 3.2.1 and it keeps crashing. The > Raster file is 5,000,000kb in size… does anyone know any way around this? > > > > I this was an issue before but it was resolved - >

[Qgis-user] Raster Calculator Crashing

2019-01-16 Thread GILLEN Finbar
Hi, I am using the Raster Calculator in QGIS 3.2.1 and it keeps crashing. The Raster file is 5,000,000kb in size... does anyone know any way around this? I this was an issue before but it was resolved - https://issues.qgis.org/issues/18417 Regards Finbar Regards Finbar Finbar GILLEN

Re: [Qgis-user] Raster calculator questions

2018-05-04 Thread Nicolas Cadieux
Hi, I am not sure of what you mean in the first part of the question but yes, you must create the output file to receive the output from the calculator. As for the second part, QGIS currently has a big limitation with the raster calculator. I have been trying to get them to work on this for

[Qgis-user] Raster calculator questions

2018-05-03 Thread Chris House
When using raster calculator in QGIS 3 I have to create a new raster first to serve as the output. Is the intent of this to overwrite a input raster (I haven't tried this) or something else? I'm confused by this. Secondly when I specify a CRS in raster calculator I get "insufficient memory

Re: [Qgis-user] raster calculator issues

2017-07-25 Thread Eugenio Trumpy
<pedrongvenan...@gmail.com> Inviato: venerdì 21 luglio 2017 20:57 A: Eugenio Trumpy Cc: qgis-user Oggetto: Re: [Qgis-user] raster calculator issues Hi Eugenio, It should be in the installation folder, most probably on /usr/share/qgis/python/plugins/processing/algs/saga Best regards, Pedro 2

Re: [Qgis-user] raster calculator issues

2017-07-21 Thread Pedro Venâncio
ì 21 luglio 2017 15:30 > *A:* frippe12573 > *Cc:* qgis-user > *Oggetto:* Re: [Qgis-user] raster calculator issues > > It was already fixed Eugenio: > > https://github.com/qgis/QGIS/commit/74042a2dc061aba0f8c5ecc15efa11 > 1153c97bb0 > > <https://github.com/qgis/QGIS/com

[Qgis-user] Raster calculator issues

2017-07-21 Thread Eugenio Trumpy
hi all, I'm using qgis 2.18.10 (code59e0f78) installed from repo in my Ubuntu 17.04. I have problem with raster calculators algorithms. In particular: * saga (2.3.1) raster calculator - it gives me this error, both using this algorithm in a process and alone: Error executing algorithm

Re: [Qgis-user] raster calculator issues

2017-07-21 Thread Eugenio Trumpy
enerdì 21 luglio 2017 15:30 A: frippe12573 Cc: qgis-user Oggetto: Re: [Qgis-user] raster calculator issues It was already fixed Eugenio: https://github.com/qgis/QGIS/commit/74042a2dc061aba0f8c5ecc15efa53c97bb0 [https://avatars2.githubusercontent.com/u/2101651?v=4=200]<https://github.com/

Re: [Qgis-user] raster calculator issues

2017-07-21 Thread Pedro Venâncio
It was already fixed Eugenio: https://github.com/qgis/QGIS/commit/74042a2dc061aba0f8c5ecc15efa53c97bb0 Best regards, Pedro 2017-07-21 14:11 GMT+01:00 frippe12573 : > hi all, > > > I'm using qgis 2.18.10 (code59e0f78) installed from repo in my Ubuntu > 17.04. > I

[Qgis-user] raster calculator issues

2017-07-21 Thread frippe12573
hi all, I'm using qgis 2.18.10 (code59e0f78) installed from repo in my Ubuntu 17.04. I have problem with raster calculators algorithms. In particular: saga (2.3.1) raster calculator - it gives me this error, both using this algorithm in a process and alone: Error executing algorithm

[Qgis-user] Raster calculator produces Nan values

2017-03-30 Thread Geco Enterprises
Hi I am using the raster calculator to compute NDVI maps from nanosatellite images. I have one image (one out of many) for which the calculator produces an output image of Nan values. No problems with any of the other images. The original 4-band 16-bit image has values in all channels - the

Re: [Qgis-user] Raster calculator script failing for multiple rasters

2016-09-14 Thread Nicolas Cadieux
Hi what kind of error are you getting? Is Qgis just crashing? Do you get an error message? Does the script work with smaller files? Nicolas Envoyé de mon iPad > Le 14 sept. 2016 à 02:05, R HG [via OSGeo.org] > a écrit : > > Thanks Nicolas for

Re: [Qgis-user] Raster calculator script failing for multiple rasters

2016-09-14 Thread R HG
Thanks Nicolas for your reply. It does seem to be a memory problem, although it doesnt show the typical "Memory Error". Without the script I could do that operation with the same rasters. It involves four files and it is basically (a-b)*(c-d). GDAL also failed to load all files at once, so I

Re: [Qgis-user] Raster calculator script failing for multiple rasters

2016-09-13 Thread Nicolas Cadieux
Hi, I have never use the Qgis raster calculator via Python so I can't help there. What is the problem? Does Qgis crash? If so, the rasters may be to big for the memory. You mentioned the rasters were very big and that may be the problem. I recommend you test the calculation with smaller

[Qgis-user] Raster calculator script failing for multiple rasters

2016-09-13 Thread R HG
Hi, I'm trying to do raster calculations with big and multiple rasters. I am new to python, but I managed to use the QgsRasterCalculator algorithm to do the average of three rasters. The problem comes when I introduce a forth layer and try to do a more complex equation: #calculating c4s (

Re: [Qgis-user] Raster calculator

2015-10-21 Thread Alexandre Neto
Hello Wangyal, There are OR and AND operator in the raster calculator. Try putting a curved brackets around the expression. In the following expression the cell will receive the value 100 if incomras >= 2 or disclasras >= 3 or sanitatras != 0 (("incomras@1" >= 2) OR ("disclasras@1" >= 3) OR

[Qgis-user] Raster calculator

2015-10-20 Thread Tsering W. Shawa
When I try to run CombinatorialOR expression in raster calculator in QGIS I get "Expression invalid" message. Is this function not available in QGIS raster calculator? Is there any option to run this expression in GRASS or SAGA? Any suggestions or help will be appreciated. Thanks, -Wangyal

[Qgis-user] Raster calculator adding two layers

2015-08-15 Thread Lene Fischer
Hi In the raster calculator I want to add two layer with different layerextent. Both layers has data in band 1. For the output I choose the largest layerextent. The result is a file with the large layerextent - but only data in the small layer extent. It seems as if the result is only values

Re: [Qgis-user] Raster Calculator bug?

2015-07-31 Thread Stefan Kiefer
Hi Nick, back to office I was eager to try by myself. Actually it seems that the result of multiple AND or multiple layers - I didn't check this by now - results in values slightly lower 1 (e.g. 0.9995 in my case). And therefore maybe rounded to 0. What I have done is the folowing:

Re: [Qgis-user] Raster Calculator bug?

2015-07-31 Thread Stefan Kiefer
Ok, if I apply this approach (“m@1 238 AND “m@1 213 AND “m@2 123 AND “m@2 98 AND “m@3 125 AND “m@3” 99) it is perfectly working either. Except that QGis is not cleanly extrapolating the legend! After that I applied pseudocolor and 1 channel with min=0.1 and max=1 and do classify (only

Re: [Qgis-user] Raster Calculator bug?

2015-07-31 Thread Nick Papadonis
Stefan, I’m operating over a single layer and 3 bands on that layer. Nick On Jul 31, 2015, at 2:48 AM, Stefan Kiefer st_kie...@web.de wrote: Hi Nick, you are absolutely right. My thought was, that you get A layer with distinct values to identify the road. For a mask you are on the right

Re: [Qgis-user] Raster Calculator bug?

2015-07-31 Thread Nick Papadonis
Hi Stefan, On Jul 31, 2015, at 9:37 AM, Stefan Kiefer st_kie...@web.de wrote: Hi Nick, back to office I was eager to try by myself. Actually it seems that the result of multiple AND or multiple layers - I didn't check this by now - results in values slightly lower 1 (e.g. 0.9995 in my

Re: [Qgis-user] Raster Calculator bug?

2015-07-31 Thread Stefan Kiefer
Hi Nick, I believe you get a black layer because your calculation always results in 1 resp. 1,2 or 3. Unfortunately I cannot verify your equation because I have no QGis by hand in this moment. But I think you wantedt to calculate this: ((“m@1 238 AND “m@1 210) * m@1) + ((“m@2 123 AND “m@2

Re: [Qgis-user] Raster Calculator bug?

2015-07-31 Thread Stefan Kiefer
Hi Nick, I believe it is black bcause you always get a value of 1. Unfortunately I can not verify this, because I have no QGis by this moment. Most propably you wanted to calculate: (“m@1 238 AND “m@1 213 AND “m@2 123 AND “m@2 98 AND “m@3 125 AND “m@3” 99) * ((“m@1 238 AND “m@1 210) *

Re: [Qgis-user] Raster Calculator bug?

2015-07-31 Thread Stefan Kiefer
Hi Nick, you are absolutely right. My thought was, that you get A layer with distinct values to identify the road. For a mask you are on the right way, and I either don't understand the behaviour except that you operate over three layers, which of course should work. Have you tryed to generate a

Re: [Qgis-user] Raster Calculator bug?

2015-07-31 Thread Nick Papadonis
Hi Stefan, It’s my understanding black has a value of 0 in the resulting layer. I tried this and it results in similar image to step (a) and also includes other colors at lower intensities mixed in with the red. The red has the highest intensity in the greyscale. I’m looking to create a

Re: [Qgis-user] Raster Calculator bug?

2015-07-31 Thread Stefan Kiefer
Hi Nick, you are absolutely right. My thought was, that you get A layer with distinct values to identify the road. For a mask you are on the right way, and I either don't understand the behaviour except that you operate over three layers, which of course should work. Have you tryed to generate a

[Qgis-user] Raster Calculator Expression to determine color

2015-07-30 Thread Nick Papadonis
HI Folks, I’m trying to use the following expression to pick up the red colored routes on a map in which I used the info pointer tool to get the band values for the color. (“m@1 238 AND “m@1 213 AND “m@2 123 AND “m@2 98 AND “m@3 125 AND “m@3 99) * 1 Unfortunately, when this expression

Re: [Qgis-user] Raster Calculator Expression to determine color

2015-07-30 Thread Nick Papadonis
On Jul 30, 2015, at 9:29 PM, Nyall Dawson nyall.daw...@gmail.com wrote: On 31 Jul 2015 11:07 am, Nick Papadonis npapado...@gmail.com mailto:npapado...@gmail.com wrote: HI Folks, I’m trying to use the following expression to pick up the red colored routes on a map in which I

Re: [Qgis-user] Raster Calculator Expression to determine color

2015-07-30 Thread Nyall Dawson
On 31 Jul 2015 11:07 am, Nick Papadonis npapado...@gmail.com wrote: HI Folks, I’m trying to use the following expression to pick up the red colored routes on a map in which I used the info pointer tool to get the band values for the color. (“m@1 238 AND “m@1 213 AND “m@2 123 AND “m@2 98

Re: [Qgis-user] Raster Calculator bug?

2015-07-30 Thread Nick Papadonis
Folks, I’m using QGIS 10.1. The following expressions result in a black raster of 0’s, when I expected only red pixels to appears in the binary image indicating routes on a map: a) (“m@1 238 AND “m@1 213 AND “m@2 123 AND “m@2 98 AND “m@3 125 AND “m@3” 99) * 1 b) ((“m@1 238 AND “m@1

Re: [Qgis-user] Raster Calculator bug?

2015-07-30 Thread Nick Papadonis
One more comment. The resulting layer histogram is showing the pixel range spread over frequency in floating point values. Is the raster calculator performing floating point math with potential rounding error? I found it also interesting that the following expression resulted in a layer,

[Qgis-user] Raster calculator output layer is smaller than expected

2015-07-05 Thread GOODFELLOW A.
Hi all. I'm using QGIS 2.6 on a Mac 10.7.5 system. I'm attempting to create a cost surface from several raster layers. The raster layers themselves have been created from a transect across a series of vector shapefiles of a larger geographical extent. I used Raster Calculator to add the

Re: [Qgis-user] Raster calculator output layer is smaller than expected

2015-07-05 Thread Nicolas Cadieux
Hi, You have lots of steps I do not fully understand (I am on vacation after all...).nbsp; This is what I would do and I figure these steps will help you. -make sure rasters have the same CRS, resolution and the same nodata values. If you multiply rasters, the no data value on one layer will

Re: [Qgis-user] Raster Calculator

2015-04-20 Thread Carlos Carbajal
Hi Poom, I see that does not work with raster calculator, but if you employ the plugin processing (within GDAL / OGR) you'll get the result. regards, El 20/04/2015 a las 7:54, Poompavai V escribió: Hi, I have installed QGIS 2.8.1. OS: Windows 7 I am trying to use the Raster Calculator

[Qgis-user] Raster Calculator and LN

2015-03-24 Thread George Silva
Hello everyone, It seems that we have a bug on raster calculator. I tried searching the web for this, but here's the story: I'm developing a plugin that makes extensive use of the raster calculator. So far so good. I can enter my custom expressions and it seems to be working fine. However one

Re: [Qgis-user] Raster Calculator and LN

2015-03-24 Thread Nicolas Cadieux
Hi, Could it be that for your layer, 0 = null?nbsp; In that case, could this be the source of the problem?nbsp; Try changing the null value to test... Just an idea. Nicolas Cadieux M.Sc. Les Entreprises Arch#233;otec inc.#160; 8548, rue Saint-Denis Montr#233;al H2P 2H2

Re: [Qgis-user] raster calculator - no file produced

2015-02-26 Thread Pedro Venâncio
This is already fixed (tested on master) and backported to 2.8. https://github.com/qgis/QGIS/commit/0ccc07af0eacd56986fbf01418aa6d3a701e231e Thanks Jurgen! Pedro 2015-02-23 16:47 GMT+00:00 Pedro Venâncio pedrongvenan...@gmail.com: Same test on Windows produces a raster file with all pixel

Re: [Qgis-user] Raster calculator: different,extents and nodata

2015-02-25 Thread Robert
Hi Michi and everyone, Coincidentally, I also spent the better part of a whole day trying to figure out how to do the exact same thing yesterday with two float32 geotiff rasters. I tried many of the suggestions in the links Nicolas provided to no success (and many more leads - see below). I

Re: [Qgis-user] Raster calculator: different extents and nodata

2015-02-24 Thread Andre Joost
Am 24.02.2015 um 18:21 schrieb Michael.Scholz- 3) How can I query the nodata value of a band?? Without being able to query it, I cannot set it to 0 which would solve all my problems. gdalinfo should report nodata values, and gdal_translate -a_nodata should assign a defined value to it.

[Qgis-user] Raster calculator: different extents and nodata

2015-02-24 Thread Michael.Scholz
Hey! In QGIS 2.6.1 I spent the whole day on the raster calculator for some super-simple overlay calculations and I'm ending up in rage and fury. I don't want to complain about the unintuitive syntax. Rather I have some questions: 1) I have two raster with different extents. rasterA entirely

Re: [Qgis-user] Raster calculator: different extents and nodata

2015-02-24 Thread Nicolas Cadieux
Hi, I am not a raster math genius but I will give this a shot. 1). In this case all cells outside the extent of rasterB get assigned nodata which is the default -3.4028234663852886e+38 in my case. Is that correct?#160; -Yes that is a standard null data for float 16 or float 32 files.#160; It

Re: [Qgis-user] raster calculator - no file produced

2015-02-22 Thread Jürgen E . Fischer
Hi Claas, On Sun, 22. Feb 2015 at 21:11:54 +0100, Claas Leiner wrote: I've just installed QGIS 2.8 and noticed that the raster calculator writes any files on Ubuntu 12.04. The formula you typed was valid. The following error message is displayed in the console: Warning: QFileInfo ::

Re: [Qgis-user] raster calculator - no file produced

2015-02-22 Thread Pedro Venâncio
Hi Claas and Jurgen, I just tested with a simple expression dem_srtm_pttm06_80m@1 * 2 and I can confirm that there is no result, both on 2.8 and 2.9 (master). Same expression, on the same machine (Xubuntu 12.04 32bits), with QGIS 2.4 and 2.6, Raster calculator works as expected. Pedro

Re: [Qgis-user] raster calculator - no file produced

2015-02-22 Thread Anita Graser
On Sun, 22. Feb 2015 at 21:11:54 +0100, Claas Leiner wrote: I've just installed QGIS 2.8 and noticed that the raster calculator writes any files on Ubuntu 12.04. The formula you typed was valid. The following error message is displayed in the console: Warning: QFileInfo :: AbsolutePath:

[Qgis-user] raster calculator - no file produced

2015-02-22 Thread Claas Leiner
Hello, I've just installed QGIS 2.8 and noticed that the raster calculator writes any files on Ubuntu 12.04. The formula you typed was valid. The following error message is displayed in the console: Warning: QFileInfo :: AbsolutePath: Constructed with empty filename Has anyone seen something

Re: [Qgis-user] raster calculator - no file produced

2015-02-22 Thread Pedro Venâncio
I also get this error message Warning: QFileInfo :: AbsolutePath: Constructed with empty filename when I double click in the Raster band to add the raster to Raster calculator expression. After that, I don't get any other error, but I also don't get any result. Best regards, Pedro

Re: [Qgis-user] Raster calculator merge 2 grids

2014-09-19 Thread Matt Boyd
I'll answer my own question. TIFF rasters were doing null+value = null. So I converted to zmap with null = 0. Then, Grid-1+Grid2-Grid1=newgrid (where Grid1 had celles valued as 0 for null) worked. On Fri, Sep 19, 2014 at 11:33 AM, Matt Boyd mattsli...@gmail.com wrote: Hi List, trying to get

[Qgis-user] Raster calculator merge 2 grids

2014-09-18 Thread Matt Boyd
Hi List, trying to get my head around the raster calculator. I've 2 grids. Where grid 1 is null I want to replace it with grid 2. The null value reported in the tiff using the info tool is nan. It's just a single band. I've tried various iteration of this... (P_Clip_fill@10) *

Re: [Qgis-user] Raster calculator question

2014-04-29 Thread kimaidou
Thanks Alex for your help here. I keep this in mind for next time. Michael 2014-04-29 5:41 GMT+02:00 Alex Mandel tech_...@wildintellect.com: GDALInfo Band NODATA value. if known. In the case where it's not set in the header of the file then you have visually inspect the raster using the

Re: [Qgis-user] Raster calculator question

2014-04-28 Thread Andreas Neumann
Hi, Again on the raster calculator: I noticed that nodata raster cells cannot be detected. They seem to be ignored. Is there any trick to query nodata cells? They are explicitly set to nodata, not to 0. Andreas Am 24.04.2014 12:57, schrieb Carlos Cerdán: Hi Andreas: Yes, it always evaluates

Re: [Qgis-user] Raster calculator question

2014-04-28 Thread kimaidou
Hi Andreas About no data, I tried many things with no luck : NULL, none, 0, etc. If someone knows, please help (and update documentation if possible). I would like to change the nodata value, but could not find any way. It seems Grass can do it via the r.null alg, but it is not yet in

Re: [Qgis-user] Raster calculator question

2014-04-28 Thread Alex Mandel
GDALInfo Band NODATA value. if known. In the case where it's not set in the header of the file then you have visually inspect the raster using the info tool to figure out what nodata is in use. Generally all rasters in the same set from a given source use the same nodata (for batching purposes).

Re: [Qgis-user] Raster calculator question

2014-04-25 Thread Paolo Cavallini
Il 24/04/2014 15:25, Andreas Neumann ha scritto: Seems I first have to get used to the raster calculator syntax. Would be great if it would use the expression editor as is used almost everywhere else. Agreed, current syntax is quite unintuitive: during courses people is often very confused.

Re: [Qgis-user] Raster calculator question

2014-04-25 Thread kimaidou
Hi Andreas, I totally agree with the benefit of using SQL-like syntax as in expressions to calculate rasters. I would prefer something like CASE WHEN raster1@1 raster2@1 THEN raster1@1 ELSE raster2@1 END Having to multiply the result of a condition (0 or 1) by the band value to actually get

Re: [Qgis-user] Raster calculator question

2014-04-25 Thread Paolo Cavallini
Il 25/04/2014 11:02, kimaidou ha scritto: I would prefer something like CASE WHEN raster1@1 raster2@1 THEN raster1@1 ELSE raster2@1 END Hi. Could you please add this to the ticket? Thanks. -- Paolo Cavallini - www.faunalia.eu QGIS PostGIS courses: http://www.faunalia.eu/training.html

Re: [Qgis-user] Raster calculator question

2014-04-25 Thread kimaidou
Hi Paolo. Sure ! Could you pass me the link please ? Thanks 2014-04-25 11:04 GMT+02:00 Paolo Cavallini cavall...@faunalia.it: Il 25/04/2014 11:02, kimaidou ha scritto: I would prefer something like CASE WHEN raster1@1 raster2@1 THEN raster1@1 ELSE raster2@1 END Hi. Could you

Re: [Qgis-user] Raster calculator question

2014-04-25 Thread Nathan Woodrow
This would require QgsExpression to be extended to support rasters. Not sure how much work that would be. On 25/04/2014 7:02 pm, kimaidou kimai...@gmail.com wrote: Hi Andreas, I totally agree with the benefit of using SQL-like syntax as in expressions to calculate rasters. I would prefer

Re: [Qgis-user] Raster calculator question

2014-04-25 Thread Paolo Cavallini
Il 25/04/2014 11:07, kimaidou ha scritto: Hi Paolo. Sure ! Could you pass me the link please ? http://hub.qgis.org/issues/4815 see also http://hub.qgis.org/issues/7581 all the best -- Paolo Cavallini - www.faunalia.eu QGIS PostGIS courses: http://www.faunalia.eu/training.html

Re: [Qgis-user] Raster calculator question

2014-04-25 Thread kimaidou
Paolo, Thanks for the links. Nathan, Indeed, it could be great to have expressions for rasters too (only method which accepts only numerical values for params and also return numerical values.) 2014-04-25 14:43 GMT+02:00 Paolo Cavallini cavall...@faunalia.it: Il 25/04/2014 11:07, kimaidou ha

[Qgis-user] Raster calculator question

2014-04-24 Thread Andreas Neumann
Hi, I have a hard time understanding the raster calculator syntax. I would like to merge two rasters: DTM and lake mask. Let's call the one dtm and the other lake_mask. When the lake_mask has a value 0 then I would like to take the value of the lake_mask, otherwise the value of the dtm. What

Re: [Qgis-user] Raster calculator question

2014-04-24 Thread Carlos Cerdán
Hi Andreas: Yes, it always evaluates to true because of OR condition , so try: (lake_mask 0) * lake_mask + (lake_mask=0)*dtm Good luck Carlos 2014-04-24 1:53 GMT-05:00 Andreas Neumann a.neum...@carto.net: Hi, I have a hard time understanding the raster calculator syntax. I would

Re: [Qgis-user] Raster calculator question

2014-04-24 Thread Andreas Neumann
Hi Carlos, Thanks a lot. This works fine. Seems I first have to get used to the raster calculator syntax. Would be great if it would use the expression editor as is used almost everywhere else. Andreas Am 24.04.2014 12:57, schrieb Carlos Cerdán: Hi Andreas: Yes, it always evaluates to true

Re: [Qgis-user] Raster Calculator - If statements

2014-02-24 Thread Jonathan Moules
Hi Carlos, Thanks for your thoughts. One observation - it appears that you are only checking a single band at a time. However I only want the values to be changed if ALL bands have a value of 145. If only one or even two of the values are 145 then nothing should be changed, it's only when all

Re: [Qgis-user] Raster Calculator - If statements

2014-02-24 Thread Carlos Cerdán
Hi Jonathan: As I said, this works band by band... so I think maybe you would can do: ZERO For Band 1 : (band1@1=145 and band2@1=145 and band3@1=145)*band1@1 ZERO For Band 2 : (band1@1=145 and band2@1=145 and band3@1=145)*band2@1 ZERO For Band 3 : (band1@1=145 and band2@1=145 and

[Qgis-user] Raster Calculator - If statements

2014-02-21 Thread Jonathan Moules
Hi List, I have a three band raster. I want to do the following with: If (Band1 150 AND Band2 150 AND Band3 150){ Band1 = 255 Band1 = 255 Band1 = 255 } Basically set all band values to 255 when all band values are than a value of 150. All other band values should remain unchanged.

Re: [Qgis-user] Raster Calculator - If statements

2014-02-21 Thread Carlos Cerdán
Hi Jonathan: Interesting puzzle. You can get what you wish if you use GRASS (r.mapcalc and r.null). With QGIS I just got zero or null, but band by band: ZERO : (band1@1=145)*band1@1 NULL : ( ((band1@1=145)*band1@1) / ((band1@1=145)*band1@1) ) * band1@1 Explanation: 1. ZERO: When condition in

[Qgis-user] raster calculator functions

2013-10-17 Thread Sergio A Estay
Hi everybody, I am trying to convert a raster layer alt into exp(alt) or log(alt). Using the raster calculator it was impossible. Carlos Cerdán suggested me this workaround: 1. *(alt@10 or alt@1=0)*2* gets a raster layer with value 2 per cell (let's put name =value2). 2. *value2^alt@1*

Re: [Qgis-user] raster calculator functions

2013-10-17 Thread Carlos Cerdán
Something is wrong. Let's see: 1. (alt@10 or alt@1=0) is a logical sentence. If value in a cell complies this condition (it's true) then value will be 1, else 0. So, if you do (alt@10 or alt@1=0)*n, you would have a layer with value n Aaaah, I see: it's the operator. It must be: (alt@10 or

Re: [Qgis-user] Raster calculator

2013-02-21 Thread Nick Hopton
It's not the spaces in the filenames causing the problem is it? Probably not, but it might be worth checking. N. -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Raster-calculator-tp5035632p5035750.html Sent from the Quantum GIS - User mailing list archive at Nabble.com.

Re: [Qgis-user] Raster calculator

2013-02-21 Thread Hanlie Pretorius
Hi, I received two replies, one suggesting it might be the spaces in the file names and another to convert all files to GeoTIFF before using the calculator. After some more tests, it seems that the spaces were the problem. And these were spaces in the layer names, not the actual file names,

[Qgis-user] Raster calculator

2013-02-20 Thread Hanlie Pretorius
Hi, If there's a way to search the whole archive of this list in one go, please let me know. Otherwise, can someone perhaps help me with this problem? I'm using the raster calculator in QGIS 1.8.0 on Windows 7 to find the difference between two rasters. The two input rasters (ASC files) both

Re: [Qgis-user] Raster calculator

2013-02-20 Thread Wesley Roberts
Hi Hanlie, I too have found interesting results returned by the raster calculator and usually default to loading the data into GRASS and processing it there. I suspect you may need to convert your input data to *.tif format for the equation to work in QGIS. This is easily done using