Thip,<br>
<br>
<span class="gmail_quote">On 8/30/05, <b class="gmail_sendername">Thip</b> &lt;<a href="mailto:thip@ait.ac.th">thip@ait.ac.th</a>&gt; wrote:</span>
<div><font face="Arial" size="2">I need to create one layer on fly using 
intersection. (Layer name&nbsp;are twy_sec and twy_su, new layer name 
is&nbsp;twy_intersection)&nbsp;SO I write down in the map file which is not 
working. Does anyone have suggestion?</font></div>
<br>
<br>
&nbsp;At the minimum you'll need to include a CLASS item in your LAYER.<br>
<br>
&nbsp;CLASS<br>
&nbsp; COLOR 255 0 0 <br>
&nbsp; OUTLINECOLOR 0 0 0<br>
&nbsp;END<br>
<br>
&nbsp;In addition you might want to check the postgis connection string. Three things that jump out at me are that <br>
<br>
1) you must use &quot;using UNIQUE gid&quot; <br>
2) you should probably rewrite it as nested selects like &quot;SELECT geom
from (SELECT intersect(...) as geom from ...) as table using unique gid
using srid = -1&quot;<br>
3) be forewarned that intersections in postgis can be painfully slow.
Depending on your users need and the size of the table, it may be worth
it to pre-process this data if speed is a factor.<br>
<br>
Also remember to put indexes on the gid column, and gist indexes on
geom. Check out the postgis docs for more details -
<a href="http://postgis.refractions.net/docs/">http://postgis.refractions.net/docs/</a><br>
<br>
Hope this helps,<br>
-- <br>Matt Perry<br><a href="mailto:perrygeo@gmail.com">perrygeo@gmail.com</a><br><a href="http://www.perrygeo.net">http://www.perrygeo.net</a>