<div dir="ltr">Hi All<br><br>I converted a raster to vector format, where the pixel values range from 1 to 8, then exported to PostGIS and made the following query:<br><br><pre style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;vertical-align:baseline;overflow:auto;width:auto;max-height:600px;word-wrap:normal">
<code style="color:rgb(34,34,34);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;font-size:12px;line-height:18px;margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:rgb(255,255,255)">   SELECT foo.value, ST_area(foo.geom::geography)
   FROM (
          SELECT c.value,
                 ST_Union(ST_Intersection(f.geom, c.geom)) as geom
          FROM fazendas f, capacidade_vect c
          WHERE  ST_Intersects(f.geom, c.geom)
          AND f.gid = 2
          GROUP BY c.value
          ORDER BY c.value
       ) AS foo;</code>
</pre>I wonder if it is possible to obtain the same results using the table in raster format (in this case <b>capacidade_rast</b>, not <b>_vect</b>), because as described above takes too long. I'm complete newbie in PostGIS Raster... Could anyone help me to build this query?<div>
<br></div><div>Thanks in advance,<br><div>-- <br><b>Marcello Benigno B. de Barros Filho</b><br><font size="1">Prof. do Curso Superior de Tecnologia em Geoprocessamento - IFPB<br>Mestre em Ciências Geodésicas e Tecnologias da Geoinformação - UFPE</font><div>
<font size="1">Doutorando em Tecnologia Ambiental e Recursos Hídricos - UFPE</font><font size="1"><br></font><font size="1"><a href="http://profmarcello.blogspot.com" target="_blank">http://profmarcello.blogspot.com</a></font><div>
<a href="http://about.me/marcello.benigno" target="_blank"><font size="1">http://about.me/marcello.benigno</font></a></div></div>
</div></div></div>