<div dir="ltr"><div class="gmail_quote"><div><font face="Arial" size="3"><span style="font-size:12pt"><div style="padding-left:72pt"><br></div>
<div><font face="Courier New"><span style="font-size:10pt">Hi,</span></font></div><div><font face="Courier New"><span style="font-size:10pt"><br></span></font></div><div><font face="Courier New"><span style="font-size:10pt">I published a Postgis-raster table as a Mapserver WCS layer using<br>
gdal-1.10dev driver. I'm getting the expected result as output of my<br>
Getcoverage query but I'm concerned by the time required to extract the<br>
data. It takes about 3 minutes to extract a 4800 x 4800 pixels area. I<br>
looked at the SQL queries performed against the database during data<br>
processing and found that an extent query is always performed in order to get<br>
the current extent of my layer using the following SQL query:<br>
<br>
select srid, nbband, st_xmin(geom) as xmin, st_xmax(geom) as xmax,<br>
st_ymin(geom) as ymin, st_ymax(geom) as ymax<br>
from (select st_srid(rast) srid, st_extent(rast::geometry) geom,<br>
max(ST_NumBands(rast)) nbband from mib_postgis.gridcoverage_<br>
cdsm75 group by st_srid(rast)) foo;<br>
<br>
srid | nbband | xmin | xmax | ymin<br>
|<i> ymax<br>
</i>------+--------+-------------------+-------------------+------------------+------------------<br>
4617 | 1 | -139.500104166667 | -52.0001041666667 | 41.5001041666667 |<br>
60.0001041666667<br>
(1 row)<br>
<br>
Time: 153033.599 ms<br>
<br>
I'm wondering how I could avoid this SQL to be performed on each call,<br>
since it is consuming a large amount of the request processing time and<br>
values are always the same.<br>
<br>
See my current mapfile definition:<br>
<br>
MAP</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> ...</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> EXTENT -139.500104166667 41.5001041666667 -52.0001041666667 60.0001041666667</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> SIZE 1150 1350</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> MAXSIZE 20000</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> UNITS DD</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> ... </span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> LAYER</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> NAME cdsm</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> GROUP cdsm</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> METADATA</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> "wcs_label" "cdsm" ### required</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> "wcs_rangeset_name" "Range 1" ### required </span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> "wcs_rangeset_label" "My Label" ### required </span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> "wcs_extent" "-139.500104166667 41.5001041666667 -52.0001041666667</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt">60.0001041666667"</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> "wcs_resolution" "0.000208333333333 0.000208333333333"</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> END</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> TYPE RASTER</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> STATUS ON</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> PROCESSING "NODATA=255"</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> DATA "PG:host=hostname port=portnumber dbname='dbname' user='username'</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt">password='passwd' schema='schema' table='gridcoverage_cdsm75' mode='2'"</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> PROJECTION</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> "init=epsg:4617"</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> END</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> END</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> ...</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt">END</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"><br>
Is it something that should be fixed at database level.<br>
</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt">Many thanks for any valuable input.<br>
<br>
J-F</span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> </span></font></div>
<div><font face="Courier New"><span style="font-size:10pt"> </span></font></div>
<div><font face="Verdana" color="gray"><span style="font-size:10pt"><b>Jean-François Bourgon</b></span></font></div>
<div><font face="Verdana" color="gray"><span style="font-size:10pt">Ressources naturelles Canada | Natural Resources Canada</span></font></div>
<div><font face="Verdana" color="gray"><span style="font-size:10pt"> </span></font></div>
<div><font face="Verdana" color="gray"><span style="font-size:10pt"> </span></font></div>
</span></font>
</div>
</div><br></div>