<HTML>
<HEAD>
<TITLE>Re: [mapserver-users] Mapscript shapeObj->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 “Segmentation fault” to “Bus error”.<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? 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. The object seems to be created fine, because I can get the number of lines with $drawnShp->numlines. I can also create a new shape object with the other shape object constructer as follows and the output works.<BR>
<BR>
<?php<BR>
dl('php_mapscript.so');<BR>
$drawnShp = ms_newShapeObj(MS_SHAPE_POLYGON);<BR>
$line = ms_newLineObj();<BR>
$line->addXY(1207657,478875);<BR>
$line->addXY(1208230,478275);<BR>
$line->addXY(1207452,477811);<BR>
$line->addXY(1207043,478520);<BR>
$line->addXY(1207657,478875);<BR>
$drawnShp->add($line);<BR>
error_log($drawnShp->numlines);<BR>
error_log($drawnShp->towkt());<BR>
?><BR>
<BR>
Is this specifically a problem with Geos 3.1 and the function ms_shapeObjFromWkt()? 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, "Yewondwossen Assefa" <<a href="yassefa@dmsolutions.ca">yassefa@dmsolutions.ca</a>> 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>
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>
(<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>
> I get a segmentation fault when I run the following simple script with<BR>
> PHP MapScript on Mac OSX 10.5.6 running the latest versions from<BR>
> www.kyngchaos.com<BR>
><BR>
> #!/usr/local/php5cgi/bin/php -q<BR>
> <?php<BR>
> dl('php_mapscript.so');<BR>
> $newwkt = 'MULTIPOLYGON(((1207657 478875,1208230 478275,1207452<BR>
> 477811,1207043 478520,1207657 478875)))';<BR>
> $drawnShp = ms_shapeObjFromWkt($newwkt);<BR>
> echo $drawnShp->toWKT();<BR>
> ?><BR>
><BR>
> /Library/WebServer/CGI-Executables/mapserv -v<BR>
> MapServer version 5.2.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP<BR>
> OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE<BR>
> SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT<BR>
> SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER<BR>
> SUPPORTS=SOS_SERVER SUPPORTS=GEOS INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR<BR>
> INPUT=GDAL INPUT=SHAPEFILE<BR>
><BR>
> The only output is;<BR>
> Segmentation fault<BR>
><BR>
> The php version is 5.2.9 and the same thing happens with php versions<BR>
> 5.2.8, 5.2.5.<BR>
><BR>
> *MapServer Version *MapServer version 5.2.2 OUTPUT=GIF OUTPUT=PNG<BR>
> OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG<BR>
> SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT<BR>
> SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER<BR>
> SUPPORTS=SOS_SERVER SUPPORTS=GEOS INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR<BR>
> INPUT=GDAL INPUT=SHAPEFILE<BR>
> *PHP MapScript Version *($Revision: 7937 $ $Date: 2008-09-30 07:37:46<BR>
> -0700 (Tue, 30 Sep 2008) $)<BR>
><BR>
><BR>
> Anybody else run into this this error? How do I get more debug information?<BR>
><BR>
><BR>
> Thanks,<BR>
><BR>
> Paul<BR>
><BR>
><BR>
> ------------------------------------------------------------------------<BR>
><BR>
> _______________________________________________<BR>
> mapserver-users mailing list<BR>
> <a href="mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><BR>
> <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: (613) 565-0925<BR>
----------------------------------------------------------------<BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>