[postgis-devel] ST_MapAlgebraExpr: Wrong output for Y-data with 'UNION'

Bryce L Nordgren bnordgren at gmail.com
Mon Nov 21 07:46:51 PST 2011


On Mon, Nov 21, 2011 at 12:00 PM, Tom van Tilburg <tom.van.tilburg at gmail.com
> wrote:

> Hi List,
>
> Can someone confirm wether I'm doing this wrong or the ST_MapAlgebraExpr
> is doing it wrong:
> I have two overlapping rasters that I want to add to eachother. The
> non-overlapping parts should  be included as well and therefore I use
> 'UNION' in the ST_MapalgebraExpr function.
>
>
Ummm, what exactly is the value of "NODATA" + rast2, or rast1 + "NODATA",
in those non-overlapping parts? NODATA is not zero. We should be
propagating NODATA thru expressions like IEEE754 (and hence most floating
point hardware, and Java, and Python, and ...) propagates NaN's. Likewise,
"SELECT NULL + 2;" in postgres (and all SQL servers) will return NULL. Is
this what you expect to see out there in the non-common regions, or are you
expecting a different result?

"Intersection" is the only useful unambiguous thing you can do to combine
two rasters using a two-raster expression. The only possible impact of
specifying Union is that you get a bigger raster result filled with more
NODATAs. The size of the non-NODATA region should not be affected.

Now, having expounded on what I think should be happening, let me hedge a
little by saying I don't really know what we're actually doing. :)

Bryce
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20111121/167322e0/attachment.html>


More information about the postgis-devel mailing list