<div dir="ltr">Hello,<div><br></div><div>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.</div>
<div><br></div><div>My version is this.</div><div>"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 (...)"<br>
</div><div><br></div><div>And I found a webpage</div><div><a href="http://trac.osgeo.org/postgis/wiki/WKTRaster/SpecificationWorking03">http://trac.osgeo.org/postgis/wiki/WKTRaster/SpecificationWorking03</a><br></div><div>
search for "ST_SelectByValue" at the bottom, indicating that it was finished.</div><div><br></div><div><h2 id="AccomplishedObjectives" style="font-family:Arial,Verdana,'Bitstream Vera Sans',Helvetica,sans-serif;letter-spacing:-0.018em;font-size:16px;color:rgb(0,0,0)">
AAccomplished Objectives<a class="" href="http://trac.osgeo.org/postgis/wiki/WKTRaster/SpecificationWorking03#AccomplishedObjectives" title="Link to this section" style="text-decoration:none;color:rgb(215,215,215);border:none;font-size:0.8em;vertical-align:text-top"></a></h2>
<p style="color:rgb(0,0,0);font-family:Verdana,Arial,'Bitstream Vera Sans',Helvetica,sans-serif;font-size:13px"><strong>ST_ValueCount(raster, value) -> integer - done see below</strong></p><p style="color:rgb(0,0,0);font-family:Verdana,Arial,'Bitstream Vera Sans',Helvetica,sans-serif;font-size:13px">
<strong>ST_ValuePercent(raster, value) -> double precision - done see below</strong></p><p style="color:rgb(0,0,0);font-family:Verdana,Arial,'Bitstream Vera Sans',Helvetica,sans-serif;font-size:13px"><strong>ST_Resample(raster, method, originx, originy, pixelsizex, pixelsizey) -> raster - done see below</strong></p>
<p style="color:rgb(0,0,0);font-family:Verdana,Arial,'Bitstream Vera Sans',Helvetica,sans-serif;font-size:13px"><strong><span class="" style="background:rgb(255,255,153)">ST_SelectByValue</span>(raster, 'expression') -> same type as first argument</strong></p>
<p style="color:rgb(0,0,0);font-family:Verdana,Arial,'Bitstream Vera Sans',Helvetica,sans-serif;font-size:13px"><strong>ST_Clip(raster|geometry,geometry) -> same type as first argument</strong></p></div></div>