[postgis-users] ST_MapalgebraExpr() function

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Fri Nov 23 05:36:37 PST 2012


Could you do this and send back the results:

SELECT (ST_summaryStats(rast)).* FROM demtest
UNION ALL
SELECT (ST_summaryStats(ST_MapAlgebraExpr(rast,'16BUI':: text,'case when [rast] between 20 and 40  then [rast] else NULL end'))).* FROM demtest

Did you try ST_Reclass?

Pierre

> -----Original Message-----
> From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-
> bounces at lists.osgeo.org] On Behalf Of Mahavir Trivedi
> Sent: Friday, November 23, 2012 5:25 AM
> To: PostGIS Users Discussion; PostGIS Users Discussion
> Subject: [postgis-users] ST_MapalgebraExpr() function
> 
> dear
>  i stored tiff image in postgis raster.
> how  do i get image which have only pixel range between  10 to 40 ?
> 
> 
> raster2psql -s 4326 -I -C -M -d  d:\test.tiff -F public. demtest > test.sql
> alter demtest add column map_rast raster
> update demtest set map_rast=ST_MapAlgebraExpr(rast,'16BUI':: text,'case
> when [rast] between 20 and 40  then [rast] else NULL end')
> 
> when i using java programm  for export ing : select ST_AsPNG(rast) from
> demtest  then output image is perfect.
> but when i write query select ST_AsPNG(map_rast) from demtest. then output
> image is not as i required.
> 
> 
> 
> with regards and thanks
> 
> mahavir trivedi


More information about the postgis-users mailing list