a particular wgs 84 bounding box and then unions with <xref linkend="RT_ST_Union" /> the intersecting tiles together returning all bands, transforms to user specified projection using <xref linkend="RT_ST_Transform" />,
and then outputs the results as a png using <xref linkend="RT_ST_AsPNG" />.</p>
<programlisting>
+<![CDATA[
<?php
$conn_str ='dbname=mydb host=localhost port=5432 user=myuser password=mypwd';
$dbconn = pg_connect($conn_str);
$input_srid = intval($_REQUEST['srid']);
}
else { $input_srid = 26986; }
-
+/** The set bytea_output may be needed for PostgreSQL 9.0+, but not for 8.4 **/
$sql = "set bytea_output='escape';
SELECT ST_AsPNG(ST_Transform(
ST_AddBand(ST_Union(rast,1), ARRAY[ST_Union(rast,2),ST_Union(rast,3)])
pg_free_result($result);
if ($row === false) return;
echo pg_unescape_bytea($row[0]);
-?></programlisting>
+?>]]></programlisting>
</sect2>
</sect1>
</chapter>