[postgis-users] ST_MapAlgebraExpr() : what is mean [rast] ?

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Tue Nov 20 07:33:13 PST 2012


You are not using the ST_MapAlgebraExpr() function properly. See:

http://postgis.refractions.net/documentation/manual-2.0/RT_ST_MapAlgebraExpr.html

The expression provided has to resolve to a number, not a boolean. Try this instead:

ST_MapAlgebraExpr(rast,'32BSI'::text,'CASE WHEN [rast] between 10 and 200 THEN [rast] ELSE NULL END') 

You can also use ST_Reclass() for this specific case.

Pierre

> -----Original Message-----
> From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-
> bounces at lists.osgeo.org] On Behalf Of Pierre Racine
> Sent: Monday, November 19, 2012 10:20 AM
> To: PostGIS Users Discussion; PostGIS Users Discussion
> Subject: Re: [postgis-users] ST_MapAlgebraExpr() : what is mean [rast] ?
> 
> Which version of PostGIS are you using?
> 
> SELECT postgis_full_version()
> 
> > -----Original Message-----
> > From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-
> > bounces at lists.osgeo.org] On Behalf Of Mahavir Trivedi
> > Sent: Monday, November 19, 2012 2:37 AM
> > To: PostGIS Users Discussion
> > Subject: [postgis-users] ST_MapAlgebraExpr() : what is mean [rast] ?
> >
> > dear friends
> >
> >
> > I would to do export my raster with 10 and 200 to pixel values only .
> >
> >
> > my large  tiff image stored in databse in tile format.
> > when I execute following query : update demtest  set rast = ST_
> > MapAlgebraExpr(rast,NULL,'[rast] between 10 and 200', NULL) where rid =2
> >  error is near "[" syntax
> >
> >
> >
> > pls any suggestion to design query ?
> >
> >
> > with regards
> > mahavir trivedi
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users


More information about the postgis-users mailing list