Let me introduce my code<br/>
I use php and oracle database.<br/>
I have an AGF geometry string ($geometryString in below code) that contain a <a href="http://en.wikipedia.org/wiki/File:Circle_arc.svg" target="_top" rel="nofollow" link="external">circular sector
</a>;<br/>
But oracle is not support AGF text format.<br/>
Oracle have "SDO_UTIL.FROM_WKTGEOMETRY" that input geometry from wkt.<br/>
I want to convert AGF to WKT and insert it to database.<br/>
How can i convert it?<br/>
<br/>
<div class="php" style="font-family:monospace;color: #006; border: 1px solid #d0d0d0; background-color: #f0f0f0;"><span style="color: #000088;">$geometryString</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;CURVEPOLYGON ((67.894181638047 32.989785090909 (LINESTRINGSEGMENT (70.229107873737 33.852692612795), CIRCULARARCSEGMENT (70.38340259381948 32.973385371885676 , 70.2175355016466 32.096187451063344))))&quot;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$conn</span> <span style="color: #339933;">=</span> oci_pconnect<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'gis'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'123456'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'127.0.0.1:1521/orcl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$conn</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$e</span> <span style="color: #339933;">=</span> oci_error<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #990000;">trigger_error</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$e</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'message'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">ENT_QUOTES</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">E_USER_ERROR</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000088;">$sql</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'INSERT INTO &quot;GIS&quot;.&quot;P&quot; (&quot;ID_AUTO&quot;, &quot;MYINT&quot;, &quot;MYSTR&quot;, &quot;GEOMETRY&quot;) VALUES (1, 123, \'asd\', SDO_UTIL.FROM_WKTGEOMETRY(\''</span><span style="color: #339933;">.</span><span style="color: #000088;">$geometryString</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'\') )'</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$stid</span> <span style="color: #339933;">=</span> oci_parse<span style="color: #009900;">&#40;</span><span style="color: #000088;">$conn</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$r</span> <span style="color: #339933;">=</span> oci_execute<span style="color: #009900;">&#40;</span><span style="color: #000088;">$stid</span><span style="color: #339933;">,</span> OCI_NO_AUTO_COMMIT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$r</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$e</span> <span style="color: #339933;">=</span> oci_error<span style="color: #009900;">&#40;</span><span style="color: #000088;">$stid</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; oci_rollback<span style="color: #009900;">&#40;</span><span style="color: #000088;">$conn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// rollback changes</span><br />
&nbsp; &nbsp; <span style="color: #990000;">trigger_error</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$e</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'message'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">E_USER_ERROR</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div>
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/how-to-convert-agf-to-wkt-tp6391716p6393870.html">Re: how to convert agf to wkt?</a><br/>
Sent from the <a href="http://osgeo-org.1803224.n2.nabble.com/MapGuide-Users-f1803227.html">MapGuide Users mailing list archive</a> at Nabble.com.<br/>