[Qgis-user] Raster calculator question

kimaidou kimaidou at gmail.com
Mon Apr 28 10:27:44 PDT 2014


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 Processing.
Some tools in QGIS, related to GDAL, seem to be able to replace a know
nodata value into another one. But it is often a chicken and egg problem,
since we do not always know the nodata value (or I am missing some other
tools like command line gdal to get it ?)

Cheers
Michael


2014-04-28 16:26 GMT+02:00 Andreas Neumann <a.neumann at carto.net>:

> 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 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.neumann at carto.net>:
> >
> >> 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 would an appropriate syntax look like?
> >>
> >> I tried something along
> >>
> >> ((lake_mask > 0) * lake_mask) OR dtm
> >>
> >> But all I get in the resulting grid are values of 1. I guess it is
> >> because it always evaluates to true?
> >>
> >> Thanks for your help.
> >>
> >> Andreas
> >> _______________________________________________
> >> Qgis-user mailing list
> >> Qgis-user at lists.osgeo.org
> >> http://lists.osgeo.org/mailman/listinfo/qgis-user
> >>
> >
> >
> >
> > _______________________________________________
> > Qgis-user mailing list
> > Qgis-user at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/qgis-user
> >
>
> _______________________________________________
> 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/20140428/990980a4/attachment.html>


More information about the Qgis-user mailing list