[Qgis-user] Problem with raster calculator

Michael Treglia mtreglia at gmail.com
Wed Apr 15 08:09:23 PDT 2015


Hi All,

Was encountering a similar problem with Raster Calculator [albeit a bit
different] just yesterday - I had a layer that had values ranging ~0-1000
(integers). I wanted the layer to represent probability values (ranging
0-1), so I used the raster calculator to divide it by 1000.

I ended up with 'nan' values displayed as the max and min on the Layers
pane and when I try to get into the properties I get a "Bad allocation"
message.   Using the 'Identify Features' tool, the values look appropriate,
but  I can't adjust the style or anything.

I ended up doing what I needed in R for now, but it would be great to work
through this issue - I'm open to any suggestions, or can send the data in
case others want to test.

Using QGIS 2.8.1 64-bit on Win7.

Cheers,
mike

On Wed, Apr 15, 2015 at 4:30 AM, Ricardo Filipe Soares Garcia da <
ricardo.garcia.silva at gmail.com> wrote:

> Hi Jesus
>
> Perhaps your input layer has no values that match the >= 73 condition?
>
> I can reproduce this behaviour if I use a layer in which pixel values go
> up to 50 and I ask for pixels >= 60.
>
> Otherwise, if the input layer has values above the threshold, it seems
> strange and I cannot seem to reproduce it here (QGIS 2.8.1)
>
>
>
>
> On Wed, Apr 15, 2015 at 8:58 AM, Jesus Munoz <jesusmunozserrano at gmail.com>
> wrote:
>
>> Good morning list!!
>>
>> I am trying to do a cloud mask for a Landsat image based on the values of
>> the pixels where the clouds are found. I am using the raster calculator for
>> this purpose by introducing the expression:
>>
>>                 (“Band 1 layer name" >= 73) * "Band 1 layer name”
>>
>> So basically, I am trying to obtain a layer in which all pixels with a
>> value lower than 73 are removed.
>>
>> However, after calculating this expression I only get an empty raster
>> layer, only visible in the layers panel and populated only by “nan” values.
>> Does anybody know what am I doing wrong???
>>
>> Jesus
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>
>
>
> --
> ___________________________ ___ __
> Ricardo Garcia Silva
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150415/df2b2469/attachment.html>


More information about the Qgis-user mailing list