[postgis-users] ST_Mapalgebra

Joan wamaithajoan at gmail.com
Tue Nov 22 05:24:19 PST 2011


Hi Bborie,

I have used ST_MapAlgebraExpr but I get the error below.

select * from (select ST_MapAlgebraExpr(kb.rast, kb1.rast,
'kb1.rast+kb.rast') as rast from kb_dsm_clip kb, kb_dsm_clip100 kb1) as r1
limit 5;
ERROR: missing FROM-clause entry for table "kb1"
LINE 1: SELECT (KB1.RAST+KB.RAST)::double precision
^
QUERY: SELECT (KB1.RAST+KB.RAST)::double precision

                                                             ^

At what point should I add :: double precision, I added it like this and
also got an error.

select * from (select ST_MapAlgebraExpr(kb.rast, kb1.rast,
'kb1.rast+kb.rast')::double precision as rast from kb_dsm_clip kb,
kb_dsm_clip100 kb1) as r1 limit 5;
ERROR: cannot cast type raster to double precision
LINE 1: ...AlgebraExpr(kb.rast, kb1.rast, 'kb1.rast+kb.rast')::double p...
^

Regards

Joan


On 21 November 2011 16:06, Bborie Park <bkpark at ucdavis.edu> wrote:

> On Mon, Nov 21, 2011 at 7:02 AM, Joan <wamaithajoan at gmail.com> wrote:
> > Hello,
> >
> > When I run the following query
> > select ST_MapAlgebra(r1.rast, r2.rast, "rast1 + rast2") from (select
> > r1.rast, r2.rast from r1, r2) as foo limit 10;
> > I get this error
> > ERROR: column "rast + rast" does not exist
> > LINE 1: ...t * from (select ST_MapAlgebra(r1.rast, r2.rast, "rast + ra...
> > ^
> > What could be the problem? What is the correct syntax for st_mapalgebra?
> > I have PostGIS installed the version updated on 18th Nov 2011.
> >
> > Joan
>
> Hey Joan,
>
> You'll want to use ST_MapAlgebraExpr or ST_MapAlgebraFct.
>
>
> http://postgis.refractions.net/documentation/manual-svn/RT_reference.html#Raster_Processing
>
> -bborie
>
> --
> Bborie Park
> Programmer
> Center for Vectorborne Diseases
> UC Davis
> 530-752-8380
> bkpark at ucdavis.edu
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20111122/70474c62/attachment.html>


More information about the postgis-users mailing list