<HTML>
<HEAD>
<TITLE>Re: [mapserver-users] Mapscript shapeObj-&gt;toWKt() or ms_shapeObjfromWkt problem.</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>I changed my Geos to version 3.0.3 and the error changed from &#8220;Segmentation fault&#8221; to &#8220;Bus error&#8221;.<BR>
I also looked at the ticket Assefa indicated below and am wondering if that was related to the buffer or to the same problem I am having? &nbsp;The script I am having problems does nothing more than create a new shape object from a wkt and then re-output the wkt from the shape object. &nbsp;The object seems to be created fine, because I can get the number of lines with $drawnShp-&gt;numlines. &nbsp;I can also create a new shape object with the other shape object constructer as follows and the output works.<BR>
<BR>
&lt;?php<BR>
&nbsp;&nbsp;&nbsp;&nbsp;dl('php_mapscript.so');<BR>
&nbsp;&nbsp;&nbsp;&nbsp;$drawnShp = ms_newShapeObj(MS_SHAPE_POLYGON);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;$line = ms_newLineObj();<BR>
&nbsp;&nbsp;&nbsp;&nbsp;$line-&gt;addXY(1207657,478875);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;$line-&gt;addXY(1208230,478275);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;$line-&gt;addXY(1207452,477811);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;$line-&gt;addXY(1207043,478520);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;$line-&gt;addXY(1207657,478875);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;$drawnShp-&gt;add($line);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;error_log($drawnShp-&gt;numlines);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;error_log($drawnShp-&gt;towkt());<BR>
?&gt;<BR>
<BR>
Is this specifically a problem with Geos 3.1 and the function ms_shapeObjFromWkt()? &nbsp;Which version of Mapserver will have the patch in ticket 2929?<BR>
<BR>
Thanks,<BR>
<BR>
Paul<BR>
<BR>
On 4/1/09 12:33 PM, &quot;Yewondwossen Assefa&quot; &lt;<a href="yassefa@dmsolutions.ca">yassefa@dmsolutions.ca</a>&gt; wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Not helping here but I have tested your script on windows with Mapserver<BR>
&nbsp;&nbsp;5.2.2 and 5.4 and the script runs ok. The geos version used in this<BR>
case is geos 2.2.3. Do you know what version of geos you are using?<BR>
There was a recent fix done toward geos support in MapServer and the<BR>
problem from what I remember was occurring with geos 3.1 (Is that<BR>
correct Tom ?)<BR>
<BR>
&nbsp;&nbsp;(<a href="http://trac.osgeo.org/mapserver/ticket/2929">http://trac.osgeo.org/mapserver/ticket/2929</a><BR>
<BR>
Best Regards<BR>
<BR>
Moen, Paul T. wrote:<BR>
&gt; I get a segmentation fault when I run the following simple script with<BR>
&gt; PHP MapScript on Mac OSX 10.5.6 running the latest versions from<BR>
&gt; www.kyngchaos.com<BR>
&gt;<BR>
&gt; #!/usr/local/php5cgi/bin/php -q<BR>
&gt; &lt;?php<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;dl('php_mapscript.so');<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;$newwkt = 'MULTIPOLYGON(((1207657 478875,1208230 478275,1207452<BR>
&gt; 477811,1207043 478520,1207657 478875)))';<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;$drawnShp = ms_shapeObjFromWkt($newwkt);<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;echo $drawnShp-&gt;toWKT();<BR>
&gt; ?&gt;<BR>
&gt;<BR>
&gt; /Library/WebServer/CGI-Executables/mapserv -v<BR>
&gt; MapServer version 5.2.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP<BR>
&gt; OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE<BR>
&gt; SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT<BR>
&gt; SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER<BR>
&gt; SUPPORTS=SOS_SERVER SUPPORTS=GEOS INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR<BR>
&gt; INPUT=GDAL INPUT=SHAPEFILE<BR>
&gt;<BR>
&gt; The only output is;<BR>
&gt; Segmentation fault<BR>
&gt;<BR>
&gt; The php version is 5.2.9 and the same thing happens with php versions<BR>
&gt; 5.2.8, 5.2.5.<BR>
&gt;<BR>
&gt; *MapServer Version &nbsp;&nbsp;&nbsp;*MapServer version 5.2.2 OUTPUT=GIF OUTPUT=PNG<BR>
&gt; OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG<BR>
&gt; SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT<BR>
&gt; SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER<BR>
&gt; SUPPORTS=SOS_SERVER SUPPORTS=GEOS INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR<BR>
&gt; INPUT=GDAL INPUT=SHAPEFILE<BR>
&gt; *PHP MapScript Version &nbsp;&nbsp;&nbsp;*($Revision: 7937 $ $Date: 2008-09-30 07:37:46<BR>
&gt; -0700 (Tue, 30 Sep 2008) $)<BR>
&gt;<BR>
&gt;<BR>
&gt; Anybody else run into this this error? &nbsp;How do I get more debug information?<BR>
&gt;<BR>
&gt;<BR>
&gt; Thanks,<BR>
&gt;<BR>
&gt; Paul<BR>
&gt;<BR>
&gt;<BR>
&gt; ------------------------------------------------------------------------<BR>
&gt;<BR>
&gt; _______________________________________________<BR>
&gt; mapserver-users mailing list<BR>
&gt; <a href="mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><BR>
&gt; <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><BR>
<BR>
<BR>
--<BR>
----------------------------------------------------------------<BR>
Assefa Yewondwossen<BR>
Software Analyst<BR>
<BR>
Email: <a href="assefa@dmsolutions.ca">assefa@dmsolutions.ca</a><BR>
<a href="http://www.dmsolutions.ca/">http://www.dmsolutions.ca/</a><BR>
<BR>
Phone: (613) 565-5056 (ext 14)<BR>
Fax: &nbsp;&nbsp;(613) 565-0925<BR>
----------------------------------------------------------------<BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>