<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I had the same problem. The solution was to change the Mapserver,
before compiling, to use the "OGR" instead of "GEOS" in the routine
generation of WKT<br>
<br>
Moen, Paul T. escreveu:
<blockquote cite="mid:C5F93ECA.1B49C%25pmoen@nd.gov" type="cite">
  <meta http-equiv="Context-Type"
 content="text/html; charset=iso-8859-1">
  <title>Re: [mapserver-users] Mapscript shapeObj-&gt;toWKt() or
ms_shapeObjfromWkt problem.</title>
  <span>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, "Yewondwossen Assefa" &lt;<a moz-do-not-send="true"
 href="yassefa@dmsolutions.ca">yassefa@dmsolutions.ca</a>&gt; wrote:<br>
  <br>
  </span>
  <blockquote> <span>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 moz-do-not-send="true"
 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; <a class="moz-txt-link-abbreviated" href="http://www.kyngchaos.com">www.kyngchaos.com</a><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 moz-do-not-send="true" href="mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
&gt; <a moz-do-not-send="true"
 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 moz-do-not-send="true" href="assefa@dmsolutions.ca">assefa@dmsolutions.ca</a><br>
    <a moz-do-not-send="true" 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> </blockquote>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
mapserver-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a>
  </pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">-- 

Edmar Moretti
CGTI/MMA
&Aacute;rea de Gest&atilde;o de Geotecnologias
Gerente de Projetos

blog: <a class="moz-txt-link-freetext" href="http://edmarmoretti.blogspot.com/">http://edmarmoretti.blogspot.com/</a>
skype: edmar.moretti</pre>
</body>
</html>