<p dir="ltr">Hi,<br>
I am not a raster math genius but I will give this a shot.</p>
<p dir="ltr">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? </p>
<p dir="ltr">-Yes that is a standard null data for float 16 or float 32 files.  It can be change with gdal-warp or gdal-translate. I suspect that is you save the file in ASCII grid format, you will have no more null values... And less hard drive space!</p>
<p dir="ltr">-If you multiply a value by a null value, you will get a null value in the answer.  That explains what is going on in point 1 and 2.</p>
<p dir="ltr">As for point 4, you can probably do it with a mask. Something like rasterA/rasterA should give you a mask with 1 where there is data and zero when not (I think. If not reset with gdal-translate).  Then you can use the AND function to combine areas and find where raster A and B intersect and work your way from there.  You could also find the extent of the rasters (in vectors) and then use the vectors to raster operation to create a mask.</p>
<p dir="ltr">Stuff I found:<br>
http://gis.stackexchange.com/questions/22786/how-to-exclude-missing-values-from-raster-layer</p>
<p dir="ltr">http://gis.stackexchange.com/questions/12418/how-to-redefine-the-nodata-value-into-zero-in-qgis<br></p>
<p dir="ltr">http://gis-lab.info/qa/rastercalc-eng.html#How_does_it_work</p>
<p dir="ltr">http://gis.stackexchange.com/questions/33764/how-to-change-null-values-raster-values-to-0-in-qgis</p>
<p dir="ltr">http://docs.qgis.org/2.6/en/docs/training_manual/rasters/terrain_analysis.html#moderate-fa-using-the-raster-calculator</p>
<p dir="ltr">http://docs.qgis.org/2.2/en/docs/training_manual/processing/no_data.html</p>
<p dir="ltr">Good luck</p>
<p dir="ltr">Nicolas Cadieux M.Sc.<br>
Les Entreprises Archéotec inc. <br>
8548, rue Saint-Denis Montréal H2P 2H2<br>
Téléphone: 514.381.5112  Fax: 514.381.4995<br>
www.archeotec.ca</p>
<div class="gmail_quote">Le 2015-02-24 12:26, "Michael.Scholz [via OSGeo.org]      " <<a href="/user/SendEmail.jtp?type=node&node=5189844&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>> a écrit :<br type='attribution'><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

        Hey!
<br />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:
<br />1) I have two raster with different extents. rasterA entirely contains rasterB. When I add these rasters (rasterA + rasterB) and set the output extent to the same as of rasterA, my result is only defined at the overlapping area of both rasters. 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?
<br />2) I extended rasterB to have the same extent as rasterA by filling the missing cells with "nodata". rasterA + rasterB still gives the same result as in 1). Why is "rasterA + nodata = nodata"? I just want values from rasterB to be added to values of rasterA AND keeping rasterA entirely where rasterB has no values.
<br />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.
<br />4) I would like to express something like "(rasterB = nodata AND rasterA != nodata) * rasterA + (rasterB != nodata) * (rasterA + rasterB)". Is that possible?
<br /><br />Still in love with QGIS
<br />Michi Scholz
<br />_______________________________________________
<br />Qgis-user mailing list
<br /><a href="/user/SendEmail.jtp?type&#61;node&amp;node&#61;5189746&amp;i&#61;0">[hidden email]</a>
<br /><a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_top" rel="nofollow" link="external">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br />

        
        
        
        <br />
        <br />
        <hr noshade="noshade" size="1" />
        <div style="color:#444;font:12px 'tahoma' , 'geneva' , 'helvetica' , 'arial' , sans-serif">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://osgeo-org.1560.x6.nabble.com/Raster-calculator-different-extents-and-nodata-tp5189746.html" target="_top" rel="nofollow" link="external">http://osgeo-org.1560.x6.nabble.com/Raster-calculator-different-extents-and-nodata-tp5189746.html</a>
        </div>
        <div style="color:#666;font:11px 'tahoma' , 'geneva' , 'helvetica' , 'arial' , sans-serif;margin-top:0.4em;line-height:1.5em">
                To start a new topic under Quantum GIS - User, email ml-node+s1560n4125267h38@n6.nabble.com <br />
                To unsubscribe from Quantum GIS - User, <a href="http://osgeo-org.1560.x6.nabble.com/template/NamlServlet.jtp?macro&#61;unsubscribe_by_code&amp;node&#61;4125267&amp;code&#61;bmljb2xhcy5jYWRpZXV4QGFyY2hlb3RlYy5jYXw0MTI1MjY3fDYzNDQ4MjQxNg&#61;&#61;">click here</a>.<br />
                <a href="http://osgeo-org.1560.x6.nabble.com/template/NamlServlet.jtp?macro&#61;macro_viewer&amp;id&#61;instant_html%21nabble%3Aemail.naml&amp;base&#61;nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&amp;breadcrumbs&#61;notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" style="font:9px serif">NAML</a>
        </div></blockquote></div>

        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Raster-calculator-different-extents-and-nodata-tp5189746p5189844.html">Re: Raster calculator: different extents and nodata</a><br/>
Sent from the <a href="http://osgeo-org.1560.x6.nabble.com/Quantum-GIS-User-f4125267.html">Quantum GIS - User mailing list archive</a> at Nabble.com.<br/>