<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Ven, <br>First,&nbsp; I took a quick look at the php mapscript documentation (my preferred mapscript) and didn't see anything specific about splitting. Solving a more simplified problem might be a start.<br><br>Start by getting the bounding box of the polygon ($shp-&gt;bounds). <br>Get the two left side coordinates: $p1=(MinX, MaxY), $p2=(MinX, MinY)<br>Build a new polygon using these two points and the endpoints of your line. <br>--&gt; Assumption that your line is not horizontal or intersects the left edge of your bbox. <br><br>Use the shapeObj::intersection to get the half of your target polygon within the left half of the BBOX. <br><br>You can repeat this for the right half of the BBOX, or maybe use shapeObj::difference.<br><br>My first thoughts. <br><br>You could, alternatively, loop through all of $shp-&gt;lines(1..$shp-&gt;numlines) and checking for
 intersection with your split line. A little bookkeeping would allow you to build your two split polygons from this.&nbsp; I think option 1 might be easier. <br><br>Hope this helps, <br><br>Josh<br><br>--- On <b>Tue, 9/7/10, venkat <i>&lt;ven.tammineni@gmail.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: venkat &lt;ven.tammineni@gmail.com&gt;<br>Subject: [mapserver-users] Split Polygon using Clint or server side code not with PostGIS<br>To: mapserver-users-request@lists.osgeo.org, mapserver-users@lists.osgeo.org<br>Date: Tuesday, September 7, 2010, 1:46 AM<br><br><div id="yiv545779720"><font color="#3366ff">Dear All,</font><div><font color="#3366ff"><br></font></div><div><font color="#3366ff">&nbsp;&nbsp; How i can split polygon by client(JavaScript&nbsp;code) or Server side(C#).I have done splitting polygon using Postgis..I am not able to understand how to split
 polygon by code(client&nbsp;or server side code.Please let me know .Its very urgent.</font></div>
<div><font color="#3366ff"><br></font></div><div><font color="#3366ff">&nbsp;I am waiting for your great response.</font></div><div><font color="#3366ff"><br></font></div><div><font color="#3366ff">Thanks and Regards,</font></div>
<div><font color="#3366ff"><br></font></div><div><font color="#3366ff">Ven</font></div>
</div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>mapserver-users mailing list<br><a ymailto="mailto:mapserver-users@lists.osgeo.org" href="/mc/compose?to=mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br></div></blockquote></td></tr></table>