<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><div id="yiv708495508"><table id="yiv708495508bodyDrftID" class="yiv708495508" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td id="yiv708495508drftMsgContent" style="font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit; font-family: arial; font-size: 10pt;"><div id="yiv708495508"><table id="yiv708495508bodyDrftID" class="yiv708495508" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td id="yiv708495508drftMsgContent" style="font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit; font-family: arial; font-size: 10pt;"><div id="yiv708495508"><table id="yiv708495508bodyDrftID" class="yiv708495508" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td id="yiv708495508drftMsgContent"
 style="font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit; font-family: arial; font-size: 10pt;"><div id="yiv708495508"><table id="yiv708495508bodyDrftID" class="yiv708495508" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td id="yiv708495508drftMsgContent" style="font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit; font-family: arial; font-size: 10pt;">Hi,<br><br>I'm new to this list. A quick search did not find answers to two mapserver speed-optimization questions. Can someone please
 help?<br><br>1. The following two lines of PHP from my application transform an php image object into a raster map layer:<br><br>imagepng($rmap, __MAPS_PATH__ . "resource.png");<br>$map-&gt;getLayerByName("resource")-&gt;set("data", __MAPS_PATH__ . "resource.png"); <br><br>The imagepng call is a major bottleneck when the extent of the layer is large.<br>Can the data in
 image "$rmap" be accessed for layer "resource" directly, without the file write/read? If so, how? FYI, the following lines appear in my mapfile:<br><br>&nbsp; LAYER<br>&nbsp;&nbsp;&nbsp; NAME resource<br>&nbsp;&nbsp;&nbsp; DATA "resource.png"<br>&nbsp;&nbsp;&nbsp; TYPE raster<br>&nbsp;&nbsp;&nbsp; PROCESSING "RESAMPLE=NEAREST"<br>&nbsp; END<br><br>2. When
 large vector layers are included in the map, or when the layer consists of labels, the mapObj's draw method is slow, even if only a small portion of the layer data is needed.<br><br>Sample SQL that created the layer data column is:<br><br>CREATE TABLE domains (<br>&nbsp;&nbsp;&nbsp; domid integer PRIMARY KEY,<br>&nbsp;&nbsp;&nbsp; ...<br>);<br>SELECT AddGeometryColumn('','domains','boundaries','4326','MULTIPOLYGON',2);<br>\i boundaries.sql; /* contains a bunch of INSERT INTOs */<br>CREATE INDEX dombound_idx ON domains USING gist (boundaries);<br>ALTER TABLE domains CLUSTER ON dombound_idx;<br><br>and the mapfile has:<br><br>&nbsp; LAYER<br>&nbsp;&nbsp;&nbsp; CONNECTIONTYPE postgis<br>&nbsp;&nbsp;&nbsp; PROCESSING "CLOSE_CONNECTION=DEFER"<br>&nbsp;&nbsp;&nbsp; NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; boundaries<br>&nbsp;&nbsp;&nbsp; DATA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "boundaries from domains using unique
 domid"<br>&nbsp;&nbsp;&nbsp;
 TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; POLYGON<br>&nbsp;&nbsp;&nbsp; CLASS<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ... <br>&nbsp;&nbsp;&nbsp; END<br>&nbsp; END<br><br>Any suggestions for speeding this up?<br><br>Thanks a bunch,<br>Vince<br><br></td></tr></tbody></table></div></td></tr></tbody></table></div></td></tr></tbody></table></div></td></tr></tbody></table></div></td></tr></table><br>