Hi,<br><br>I would like to change some of the&nbsp; code in mappostgis.c to reflect C 5.2 Nearest Value instructions found in&nbsp; WMS 1.1.1 specifications for &quot;TIME&quot; parameter. <a href="http://portal.opengeospatial.org/files/?artifact_id=1081&amp;version=1&amp;format=pdf">
http://portal.opengeospatial.org/files/?artifact_id=1081&amp;version=1&amp;format=pdf</a><br><br>Here what it says in the WMS 1.1.1 doc.<br><br>&quot;If a request does includes an imprecise dimensional value, and nearest value behavior has been declared, then the server shall compute and send the nearest available value. The value shall be rounded, not merely truncated.&quot;
<br><br>Right now, mapserver is using date_trunc function to allow the user to specify months, days, hours or minutes.&nbsp; I think this could be enhanced to get the nearest time value in Postgres.&nbsp; For example,&nbsp; NASA GES has 3 hourly data.&nbsp; If the user&nbsp; specify 2006-09-28T02:00&nbsp; a blank image is return, the user needs to be exact 2006-09-28T03:00.&nbsp; Same thing with 10-day data,&nbsp; 2006-09-03 will&nbsp; return a&nbsp; blank image.&nbsp; User have to hit the right date 2006-08-10, 2006-08-20, 2006-08-31, 2006-09-10,....&nbsp; 
<br><br>Example<br>Tropical Rain data 3B42_V6_10_DAY:<br><a href="http://g0hep12u.ecs.nasa.gov/mapserv-bin/wms_ogc?SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=Getmap&amp;layers=bluemarble,TRMM_3B42_V6_10_DAY&amp;BBOX=-180,-50,180,50&amp;TIME=2005-08-20">
http://g0hep12u.ecs.nasa.gov/mapserv-bin/wms_ogc?SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=Getmap&amp;layers=bluemarble,TRMM_3B42_V6_10_DAY&amp;BBOX=-180,-50,180,50&amp;TIME=2005-08-20</a><br><br>blank image<br><a href="http://g0hep12u.ecs.nasa.gov/mapserv-bin/wms_ogc?SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=Getmap&amp;layers=bluemarble,TRMM_3B42_V6_10_DAY&amp;BBOX=-180,-50,180,50&amp;TIME=2005-08-20T04:00">
http://g0hep12u.ecs.nasa.gov/mapserv-bin/wms_ogc?SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=Getmap&amp;layers=bluemarble,TRMM_3B42_V6_10_DAY&amp;BBOX=-180,-50,180,50&amp;TIME=2005-08-20T04:00</a><br><br><br>Let me know if this make sense to you.&nbsp; I would be happy to contribute some coding for this.
<br><br><br>Denis<br><br><br>