Thip,<br>
<br>
<span class="gmail_quote">On 8/30/05, <b class="gmail_sendername">Thip</b> <<a href="mailto:thip@ait.ac.th">thip@ait.ac.th</a>> wrote:</span>
<div><font face="Arial" size="2">I need to create one layer on fly using
intersection. (Layer name are twy_sec and twy_su, new layer name
is twy_intersection) SO I write down in the map file which is not
working. Does anyone have suggestion?</font></div>
<br>
<br>
At the minimum you'll need to include a CLASS item in your LAYER.<br>
<br>
CLASS<br>
COLOR 255 0 0 <br>
OUTLINECOLOR 0 0 0<br>
END<br>
<br>
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 "using UNIQUE gid" <br>
2) you should probably rewrite it as nested selects like "SELECT geom
from (SELECT intersect(...) as geom from ...) as table using unique gid
using srid = -1"<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>