If you set the values you're looking for to themselves and other pixels to nodata, ST_Reclass is equivalent to ST_SelectByValue.
> -----Original Message----- > From: [email protected] [mailto:postgis-users- > [email protected]] On Behalf Of David Haynes > Sent: Thursday, June 05, 2014 3:34 PM > To: PostGIS Users Discussion > Subject: Re: [postgis-users] ST_SelectByValue > > reclass would allow me to change the values of the pixel. > > "ST_SelectByValue" is supposed to like a map algebra or in ArcGIS Terms > select by attribute. > > > On Thu, Jun 5, 2014 at 1:38 PM, Pierre Racine > <[email protected]> wrote: > > > Try ST_Reclass(). > > > > -----Original Message----- > > From: [email protected] [mailto:postgis- > users- > > [email protected]] On Behalf Of David Haynes > > Sent: Friday, May 30, 2014 10:49 AM > > To: [email protected] > > Subject: [postgis-users] ST_SelectByValue > > > > Hello, > > > > I am fairly new to using rasters in postgis, but I am wondering if > there is a > > faster way to extract values from categorical rasters (e.g. > landcover types) > > than using map algebra. In the PostGIS in Action book, pg 404 has > a > > function called ST_SelectByValue(raster|geometry, 'expression') > which > > seems to incorporate map algebra, however I can't seem to tell if > this > > function is finished and available in postgis as I get an unknown > function > > error. > > > > My version is this. > > "PostgreSQL 9.3.2 on x86_64-unknown-linux-gnu, compiled by gcc > > (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 64-bit POSTGIS="2.1.1 > r12113" > > GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.7.1, 23 September 2009" > > GDAL="GDAL 1.9.0, released 2011/12/29" LIBXML="2.7.8" > LIBJSON="UN > > (...)" > > > > > > And I found a webpage > > > http://trac.osgeo.org/postgis/wiki/WKTRaster/SpecificationWorking03 > > > > search for "ST_SelectByValue" at the bottom, indicating that it > was finished. > > > > > > AAccomplished Objectives > > > > <http://trac.osgeo.org/postgis/wiki/WKTRaster/SpecificationWorking03#A > > ccomplishedObjectives> > > > > > > > ST_ValueCount(raster, value) -> integer - done see below > > > > ST_ValuePercent(raster, value) -> double precision - done see > below > > > > ST_Resample(raster, method, originx, originy, pixelsizex, > pixelsizey) -> raster > > - done see below > > > > ST_SelectByValue(raster, 'expression') -> same type as first > argument > > > > ST_Clip(raster|geometry,geometry) -> same type as first > argument > > > _______________________________________________ > postgis-users mailing list > [email protected] > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > > _______________________________________________ postgis-users mailing list [email protected] http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
